windows/linux上的Selenium差异
我有一个JUnit测试,它导入org.openqa.selenium.interactions.Actions 具体来说,我使用的是dragAndDrop 当我在本地机器(windows)上运行Junit测试时,它运行得非常好。但是,当在Linux机器上运行相同的测试时,该方法不起作用。测试中的其他一切运行正常,但dragAndDrop方法不起作用 一位同事表示,它可能与“XVFB”有关,但无法详细说明windows/linux上的Selenium差异,selenium,Selenium,我有一个JUnit测试,它导入org.openqa.selenium.interactions.Actions 具体来说,我使用的是dragAndDrop 当我在本地机器(windows)上运行Junit测试时,它运行得非常好。但是,当在Linux机器上运行相同的测试时,该方法不起作用。测试中的其他一切运行正常,但dragAndDrop方法不起作用 一位同事表示,它可能与“XVFB”有关,但无法详细说明 任何意见,谢谢 我假设您正在Linux上使用Firefox?Linux上的Firefox默认
任何意见,谢谢 我假设您正在Linux上使用Firefox?Linux上的Firefox默认禁用本机事件。高级操作API需要本机事件。尝试启用它们,然后检查linux上的测试,如下所示
FirefoxProfile profile = new FirefoxProfile();
profile.setEnableNativeEvents(true);
WebDriver driver = new FirefoxDriver(profile);