我想知道如何在Windows或Linux上集成selenium Grid 2和Jenkins都可以.(我能够使用TestNG和Java在同一台机器和不同的机器上成功运行Selenium Grid 2)
我们应该使用Ant来构建(目前使用GIT作为版本控制系统)吗?Jenkins/Hudson的Selenium Grid插件是否支持Grid 2?如果是这样,我们如何实现这种整合?
这是我为Chrome进行本地自动测试运行和TeamCity(CI)添加配置文件首选项的方法:
Capabilities = DesiredCapabilities.Chrome();
var chromeOptions = new ChromeOptionsWithPrefs();
chromeOptions.AddUserProfilePreference("download.default_directory", DownloadPath);
chromeOptions.AddUserProfilePreference("intl.accept_languages", "nl");
chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true");
return new ChromeDriver(chromeDriverPath, chromeOptions);
Run Code Online (Sandbox Code Playgroud)
但是当我创建新的"RemoteWebDriver"时,我必须向它发送一个中心URL和"功能",这样我就可以将配置文件首选项发送到Firefox(到RemoteWebDriver):
var profile = new FirefoxProfile();
Capabilities = DesiredCapabilities.Firefox();
profile.SetPreference("browser.helperApps.alwaysAsk.force", false);
profile.SetPreference("browser.download.useDownloadDir", true);
profile.SetPreference("browser.download.folderList", 2);
profile.SetPreference("browser.download.dir", DownloadPath);
profile.SetPreference("browser.helperApps.neverAsk.saveToDisk",
"application/zip, application/octet-stream");
Capabilities.SetCapability(FirefoxDriver.ProfileCapabilityName, profile.ToBase64String());
return Capabilities;
Run Code Online (Sandbox Code Playgroud)
有人可以帮助我,我需要像Chrome一样对Chrome做同样的事情.基本上我需要的是,我可以更改下载文件的默认路径.
我想在AWS上使用官方Docker图像设置Selenium Grid,可在此处找到https://github.com/SeleniumHQ/docker-selenium
集线器和节点应驻留在不同的计算机/ docker主机上.
我使用大使容器,如下所述:https://docs.docker.com/articles/ambassador_pattern_linking/
(中心) - >(selenium-ambassador) - 网络 - >(selenium-ambassador) - >(节点)
我创建了两个EC2实例并执行了以下命令:
在集线器上:
$ docker run -d --name selenium-hub selenium/hub:2.47.1
$ docker run -d --link selenium-hub:selenium-hub --name selenium_ambassador -p 4444:4444 svendowideit/ambassador
Run Code Online (Sandbox Code Playgroud)
在节点机器上:
$ docker run -d --name selenium_ambassador --expose 4444 -e SELENIUM_PORT_4444_TCP=tcp://<public-AWS-EC2-IP>:4444 svendowideit/ambassador
$ docker run -d --link selenium_ambassador:selenium-hub selenium/node-chrome:2.47.1
Run Code Online (Sandbox Code Playgroud)
运行最后一个命令后,我在节点机器上收到以下错误消息:
Not linked with a running Hub container
Run Code Online (Sandbox Code Playgroud)
每台EC2机器上的安全组允许端口22和4444.
我希望,任何人都可以帮助我或给我一个线索?提前致谢.
我在AWS实例上设置了selenium grid2,我想知道是否有办法在本地计算机上查看日志?
我知道我可以访问:http:// MyServerAddress/grid/console并查看所有节点,但我想要实际的日志.每次我想查看它时,都需要远程桌面到服务器有点痛苦.
我在想像http:// MyServerAddress/grid/log,但是唉,它似乎不是一个选择.
automated-tests selenium-grid selenium-webdriver selenium-grid2