I need a way to try to click on an element, but if it is not there, the test should not fail.
Kind of an “fire and forget” click.
I want to do that directly in Selenese (or js, as for user-extensions.js) , and not in PHPUnit/JUnit.
I thought maybe of a “user-extensions”-function to do this, so i searched the openqa Site but i didn’t find anything useful.
Update: My own first try: (not working)
Selenium.prototype.doClickAndForget= function(locator) {
this.page().click(locator));
return true;
};
Any Ideas on how to make it work?
I did it with “storeEval()” and pure js.
Either i got a valid link or i returned a mandatory element to “fake klick” on, so sel will not throw any errors.
Its a hack but i had “unpredefined” content on my site, so i needed a way to handle the possibilities.