Selenium sendKeys() different behaviour for Chrome, Firefox and Safari

后端 未结 2 644
眼角桃花
眼角桃花 2021-01-17 02:30

Below is simple snippet of code.

@FindBy(className = \"element-to-press\")
private WebElement elementToPress;

// some other code

Keys move = Keys.ARROW_DOW         


        
2条回答
  •  -上瘾入骨i
    2021-01-17 03:30

    Update 2

    Refer the above answer for fullcode


    Update 1

    SafariDriver Extension doesn't work with Selenium 2.46.I've tried it and you have to downgrade the Selenium to 2.45 as SafariDriver Extension for 2.46 is not released yet.Refer this GitHub Issue

    So as of now go with Selenium 2.45


    Initial Answer

    You have to install SafariDriver Extension Manually

    As per SafariWiki

    Starting with Selenium 2.45.0, you must manually install the SafariDriver browser extension. Simply open the latest copy of SafariDriver.safariextz in Safari and click the "install" button. Once installed, writing a test for Safari is just as straightforward as using the FirefoxDriver

提交回复
热议问题