Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
windows/linux上的Selenium差异_Selenium - Fatal编程技术网

windows/linux上的Selenium差异

windows/linux上的Selenium差异,selenium,Selenium,我有一个JUnit测试,它导入org.openqa.selenium.interactions.Actions 具体来说,我使用的是dragAndDrop 当我在本地机器(windows)上运行Junit测试时,它运行得非常好。但是,当在Linux机器上运行相同的测试时,该方法不起作用。测试中的其他一切运行正常,但dragAndDrop方法不起作用 一位同事表示,它可能与“XVFB”有关,但无法详细说明 任何意见,谢谢 我假设您正在Linux上使用Firefox?Linux上的Firefox默认

我有一个JUnit测试,它导入org.openqa.selenium.interactions.Actions

具体来说,我使用的是dragAndDrop

当我在本地机器(windows)上运行Junit测试时,它运行得非常好。但是,当在Linux机器上运行相同的测试时,该方法不起作用。测试中的其他一切运行正常,但dragAndDrop方法不起作用

一位同事表示,它可能与“XVFB”有关,但无法详细说明


任何意见,谢谢

我假设您正在Linux上使用Firefox?Linux上的Firefox默认禁用本机事件。高级操作API需要本机事件。尝试启用它们,然后检查linux上的测试,如下所示

FirefoxProfile profile = new FirefoxProfile();
profile.setEnableNativeEvents(true);
WebDriver driver = new FirefoxDriver(profile);