标签: selenium-grid2

Selenium可以在一个浏览器中使用多线程吗?

我想在多线程中测试一个Web但是当我打开太多的chromedrivers时他们会使用太多的内存.我可以在一个浏览器中使用多线程吗?

selenium multithreading selenium-grid2

19
推荐指数
2
解决办法
3万
查看次数

如何在远程webdriver/grid配置中的节点端设置firefox配置文件

始终建议在DesiredCapabilities中设置firefox配置文件,并将其传递到集线器正在运行的线路.如下

DesiredCapabilities caps = DesiredCapabilities.firefox();

    FirefoxProfile profile=new FirefoxProfile(new File("Local Path to firefox profile folder"));
    caps.setCapability(FirefoxDriver.PROFILE, profile);

URL url = new URL("http://localhost:4444/wd/hub");      
WebDriver driver= new RemoteWebDriver(url,caps );
Run Code Online (Sandbox Code Playgroud)

但是,对于每个硒测试案例,将大量的87-90 mb配置文件信息通过http发送到集线器,从而减慢了测试用例的执行速度.

我尝试"Dwebdriver.firefox.profile=E:\\Firefox_Profile_Location":"",在json节点配置文件中使用属性配置网格节点,如下所示.

{
"configuration":
{
.//Other Settings
.//Other Settings
.//Other Settings
"Dwebdriver.firefox.profile=E:\\Firefox_Profile_Location":"",
"maxSession":7,
"registerCycle":5000,
"register":true
},
"capabilities":
[

{"browserName":"firefox",
"seleniumProtocol":"WebDriver",
"maxInstances":5,
"platform":"VISTA"
}
]
}
Run Code Online (Sandbox Code Playgroud)

但运行上述配置会导致错误.

WebDriverException:未找到系统属性"webdriver.firefox.profile"中命名的Firefox配置文件"E:\ Firefox_Profile_Location"

高级感谢有关如何从节点端配置firefox配置文件的任何帮助.

selenium selenium-webdriver remotewebdriver selenium-grid2

12
推荐指数
1
解决办法
2962
查看次数

geckodriver:如何在node.config上为selenium grid指定"moz:firefoxOptions"

我正在使用nunit C#在selenium网格上运行测试:

  • selenium-standalone-server:v3.3.1
  • selenium webdriver:v3.3
  • geckodriver:0.15
  • firefox:v52

Firefox未安装在默认位置,因此我在运行测试时遇到以下异常:

预期的浏览器二进制位置,但无法在默认位置找到二进制文件,未提供'moz:firefoxOptions.binary'功能,并且在命令行上未设置二进制标志(警告:服务器未提供任何堆栈跟踪信息)

我想在node.configselenium网格文件的功能部分指定Firefox可执行文件路径.我如何使用新的geckodriver做到这一点?

firefox_binary现在已经过时,它使用"moz:firefoxOptions",但我不知道如何在selenium节点的配置文件中指定它.

这是我在配置文件中所做的,但它不起作用:

{
  "capabilities":
  [
    {
      "platform": "WINDOWS",
      "browserName": "firefox",
      "moz:firefoxOptions": {
        "binary": "D:\\Browsers\\Mozilla Firefox\\firefox.exe"
        },
      "maxInstances": 1,
      "seleniumProtocol": "WebDriver"
    }
  ]
.........
Run Code Online (Sandbox Code Playgroud)

firefox selenium-webdriver selenium-grid2 geckodriver

11
推荐指数
1
解决办法
2891
查看次数

远程webdriver - 使用Rest Client Extension(附加组件)传递firefox配置文件

目前我可以通过RemoteWebDriver发送firefox配置文件,但我无法通过配置文件发送RestCLient扩展.我需要一个REST客户端扩展(firefox附加组件)才能用于我的测试用例执行.

如果我使用firefox驱动程序在本地运行测试用例,它可以工作....但是如何使用RemoteWebDriver实现相同的功能呢?

 File profileDirectory = new File("c://mach//lib//prof");
 FirefoxProfile profile = new FirefoxProfile(profileDirectory);
 driver = new FirefoxDriver(profile);
 driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
Run Code Online (Sandbox Code Playgroud)

干杯

java remotewebdriver selenium-grid2

9
推荐指数
1
解决办法
1万
查看次数

带有Chrome驱动程序的Selenium网格(WebDriverException:驱动程序可执行文件的路径必须由webdriver.chrome.driver系统属性设置)

我想让我的Selenium Grid在Chrome驱动程序上运行.

起初我开始使用hub和node:java -jar selenium-server-standalone-2.45.0.jar -role hub java -jar selenium-server-standalone-2.45.0.jar -role node -hub http:// localhost: 4444 /网格/寄存器

比我启动我的测试:

public class ChromeDriverTest {
    private WebDriver driver = null;
    String  BaseURL,NodeURL;

@Before
public void before() throws Exception{
    BaseURL="http://www.google.com";
    NodeURL="http://localhost:4444/wd/hub";
    File file = new File("C:\\Users\\pushkaryova\\Desktop\\Nexus\\driver\\chromedriver.exe");
    System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
    DesiredCapabilities capa =DesiredCapabilities.chrome();
    capa.setBrowserName("chrome");
    capa.setPlatform(Platform.ANY);
    driver=new RemoteWebDriver(new URL(NodeURL),capa);
}

@Test
public void GoogleSearch() throws Exception {
    driver.get("http://www.google.com");
    WebElement searchBox = driver.findElement(By.xpath("//div[3]/div/input[1]"));
    hightlight(searchBox);
    driver.findElement(By.xpath("//div[3]/div/input[1]")).clear();
    driver.findElement(By.xpath("//div[3]/div/input[1]")).sendKeys("Test");
    driver.findElement(By.xpath("//button")).click();

}

public void hightlight(WebElement webElement) throws InterruptedException {
    for (int i …
Run Code Online (Sandbox Code Playgroud)

java selenium selenium-chromedriver selenium-grid2

8
推荐指数
1
解决办法
4万
查看次数

如何在Selenium Grid2中运行Watir-Webdriver测试

我可能会遗漏一些明显的东西,但这里是我设置的:

  1. CentOs 6.4无头VM(运行Selenium hub)
  2. CentOs 6.4无头虚拟机(运行节点)(与#1相同的虚拟机)
  3. Windows Xp Pro VM(运行节点)
  4. CentOs 6.4无头VM(运行Watir测试)

在1,2和4上,我运行命令rvm使用ruby-2.1.1,并应用puppet模块安装以下宝石:['watir-webdriver','headless','bacon','selenium-webdriver ','rspec','黄瓜','测试单位','页面对象','ci_reporter']

然后,在#1上,我运行:

java -Xms1024M -Xmx2048M -jar selenium-server-standalone-2.40.0.jar -role hub

在#2上,(与#1机器相同,我运行:

java -jar selenium-server-standalone-2.40.0.jar -role node -host <#1 VM DNS> -port 5555 -hub http://<#1VM DNS>:4444/grid/register
Run Code Online (Sandbox Code Playgroud)

或者命令:

java -jar selenium-server-standalone-2.40.0.jar -role node -hub http://<#1 VM DNS>:4444/grid/register -maxSession 20 -port 5555
Run Code Online (Sandbox Code Playgroud)

在两种情况下,我没有得到集线器上的指示,该节点确实已连接,或者在已注册到集线器的节点上,我在该节点上获得的最后一行是:

06:20:03.931 INFO - Starting auto register thread. Will try to register every 5000 ms.
06:20:03.932 INFO - Registering the node to hub :http://<#1 VM DNS>:4444/grid/register
Run Code Online (Sandbox Code Playgroud)

IMO,"注册"表示正在进行中,尚未完成.无论如何,所以我打开了中心控制台@

http:// <#1 …

ruby watir-webdriver selenium-grid2

6
推荐指数
0
解决办法
2098
查看次数

Selenium网格提供例外:PROXY_REREGISTRATION

我现在能够成功运行selenium grid 2,感谢你们.现在我面临一个新问题,即:由于PROXY_REREGISTRATION,会话[xxxxx]被终止

根据我读到的,它表示节点已断开连接并正在重试连接到主机,但失败了.

但我想要的是,如何解决这个异常.而是如何处理它>> ??? 有谁知道这个相关的东西?

java selenium selenium-grid2

6
推荐指数
1
解决办法
1962
查看次数

Using Docker, with Selenium and Pytest to run parallel tests

I'm trying to use these all things together to run parallel tests in a headless chrome:

Docker, Selenium, Pytest

However, I'm wondering where it makes sense to run the parallel part of the system?

Docker can do this (using selenium grid). Both these can be used to run parallel (and distributed) selenium tests. e.g.

https://github.com/elgalu/docker-selenium

https://github.com/zalando/zalenium

Also Pytest has its own way of running parallel tests (using pytest-xdist) e.g.

http://pytest.org/dev/xdist.html

Would it be easier to run 10 parallel pytest-xdist than …

parallel-processing selenium docker selenium-grid2 xdist

5
推荐指数
1
解决办法
1653
查看次数

如何在Selenium Grid中终止会话(附加)

如何在Selenium Grid中终止会话?我的问题是,如果我的测试失败集线器仍然保持此测试的会话,我不能运行另一个测试(它运行但失败,因为无法获得免费节点,因为它在集线器中注册).我已经找到了如何在Selenium Grid节点中杀死线程并且有一个使用的答案,DELETE /session/:sessionId但它对我不起作用.关于Selenium Grid或Extras的文档是非常纯粹的,也许有些人有类似的问题并知道如何解决它?

selenium-grid selenium-grid2

5
推荐指数
2
解决办法
9392
查看次数

如何在CloudFoundry上运行Selenium-Grid?

有人用Gorouter提供的路由在CloudFoundry上运行Selenium-Grid吗?

根据“ Selenium-Grid文档”,我们可以将集线器地址传递给这样的节点实例:

java -jar selenium-server-standalone.jar \ 
  -role node \
  -hub http://myhub.cf/grid/register 
Run Code Online (Sandbox Code Playgroud)

但是此节点使用本地地址和端口注册自己。

selenium-grid cloud-foundry selenium-grid2

3
推荐指数
1
解决办法
459
查看次数