Reputation: 229
I want to click on following button but When I run script button is not clicked still script is passing.
Here is HTML snipped
<input type="button" value="Authorize" class="standard" id="oauth2button" style="margin-left: 60px;">
Here is ruby code which i used to perform click operation
authorize_button = $driver.find_element(:id, 'oauth2button')
authorize_button.click
If I use authorize_button.displayed?
it returns true.
I am using Selenium WebDriver and Safari version is 6.1.1
Upvotes: 4
Views: 2688
Reputation: 2277
This may not be the answer you are looking for but one thing I've done when I encounter that kind of problems is to use JavaScript to execute that particular action instead of Selenium, that has worked for me every time. You could try something like:
$driver.execute_script("document.getElementById('oauth2button').click();")
Upvotes: 1