Some click dont work in Safari browser using selenium standalone server Some click dont work in Safari browser using selenium standalone server selenium selenium

Some click dont work in Safari browser using selenium standalone server


Try using javascript executor

WebElement yourelement= driver.findElement(By.id("btn"));JavascriptExecutor executor = (JavascriptExecutor)driver;executor.executeScript("arguments[0].click();", yourelement);


I had the same problem. After a long time of debugging I found out that the problem was that the JS wasn't fully loaded before Safari did it's binding so I had to wait a long time after the pageload before doing the test.

I server side rendered the button (react component) but the function of the button was implemented when the document was ready.


I had the same issue with Safari 10+, OSX El Capitan and Selenium 3.0.1

Another alternative may be to send a RETURN key implemented in Python:

from selenium import webdriverfrom selenium.webdriver.common.keys import Keysdriver = webdriver.Safari()driver.get('http://localhost:8000')element = driver.find_element_by_id("submit")element.send_keys(Keys.RETURN)