- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我将 selenium 网格与用 ruby/watir/cucumber 编写的测试一起使用,以通过并行化加速。我的网格中有一些我想在工作日使用的节点,还有一些我只想在晚上使用的节点。我认为可以通过使用 applicationName 功能来实现。现在我的代码看起来像这样:
@driver= FigNewton.browser
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 360
@env = ENV['ENV']
@env ||= 'local'
if @env == 'local' then
@browser = Watir::Browser.new @driver , :http_client => client
else
@hub_url = ENV['HUB_URL']
@hub_url ||= 'http://localhost:4444/wd/hub'
@browser = Watir::Browser.new(:remote, :url=>"http://localhost:4444/wd/hub", :desired_capabilities => @driver.downcase.to_sym)
end
但是当我以这种方式设置功能时,无法更改 applicationName。所以我尝试使用下一个代码:
@driver= FigNewton.browser
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 360
@env = ENV['ENV']
@env ||= 'local'
if @env == 'local' then
@browser = Watir::Browser.new @driver , :http_client => client
else
@hub_url = ENV['HUB_URL']
@hub_url ||= 'http://localhost:4444/wd/hub'
caps = Selenium::WebDriver::Remote::Capabilities.firefox
caps[:applicationName] = "test"
@browser = Watir::Browser.new(:remote, :url=>"http://localhost:4444/wd/hub", :desired_capabilities => caps)
end
我的节点使用下一个命令启动:
java -jar selenium-server-standalone-2.44.0.jar -role node -host testHost -hub http://localhost:4444/grid/register -maxSession 20 -browser browserName=firefox,maxInstances=10 -browser browserName=chrome,maxInstances=10,applicationName=test
但是当我使用第二种方法时,我遇到了下一个异常:
Error forwarding the new session cannot find : Capabilities [{platform=ANY, cssSelectorsEnabled=true, javascriptEnabled=true, browserName=firefox, applicationName=test, nativeEvents=false, rotatable=false, takesScreenshot=true, version=}] (org.openqa.grid.common.exception.GridException) (Selenium::WebDriver::Error::UnknownError)
无法弄清楚哪里出了问题。
有没有其他方法可以过滤网格中的节点?
最佳答案
找到 Undocumented way to select a node on a Selenium Grid2 , 希望对你有帮助
NODE1:
java -jar selenium-server-standalone-2.20.0.jar -role node -hub http://HUB_IP:4444/grid/register -browser browserName=firefox,version=11,maxInstances=1,platform=WINDOWS,applicationName=windows7_32bits_firefox_11
NODE2:
java -jar selenium-server-standalone-2.20.0.jar -role node -hub http://HUB_IP:4444/grid/register -browser browserName=firefox,version=11,maxInstances=1,platform=WINDOWS,applicationName=windows7_64bits_firefox_11
In your tests you have to add "applicationName=windows7_32bits_firefox_11" to your desired capabilities array.
关于ruby - webdriver ruby 绑定(bind)中的所需功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27599217/
我想在 Watir webdriver 中使用 selenium webdriver Actions。这可能吗? 也可以在 watir webdriver 中使用 java 代码。请帮忙。 我浏览了很
我正在使用 watir-webdriver 浏览我的网站并在不同的浏览器中抓取屏幕截图。 有时在 IE 中截取的屏幕截图大小合适,但颜色完全是黑色。同时运行的 Firefox 测试看起来很好。 bro
我已经编写了 driver.findElement(By.id("kfiDocumentLink")).click(); 用于单击“KFI 文档”按钮的代码。 请找到HTML代码。 Download
我有一个包含以下内容的 html 页面: This is Login page. Please click below link
我想获得页面加载异常,但仍然没有结果。 我使用implicitlyWait 设置计时器以抛出异常。 WebDriver driver = new FirefoxDriver(); driver.man
我正在使用具有 IE 特定应用程序的 Selenium Webdriver。我知道我们可以截取执行的截图。同样,是否有任何选项可以将 selenium 执行记录为视频? 最佳答案 WebDriver
Selenium WebDriver 如何克服同源策略? Selenium RC 中存在同源策略问题 最佳答案 First of all “Same Origin Policy” is introdu
我将如何从输入文件中提取文本?我尝试使用 XPath/CSSSelector 但我得到一个空文本,因为它是一个输入字段。 这是我的 html 代码: 结果:195 行中的 1 到 50
如何使用 WebDriver 自动验证码? 是否有其他方法可以使用 Webdriver 自动执行验证码? 最佳答案 您只能使用“alt”属性中的显示验证码值来自动化验证码。 在 WebElement
最近我开始学习 WebDriver,因为我工作的客户计划使用 WebDriver 来自动化 Web 应用程序。 我怀疑 WebDriver 如何在网页上定位其 ID 动态变化的元素(比如每次登录应用程
我发现 watir-webdriver 在一个非常大的页面上通过正则表达式定位元素非常慢,至少在 FF 8.0.1 中对我来说是这样。航类搜索结果页面示例(包含大约 50 个搜索结果,每个都是 htm
我有一个动态更改其文本的字段。我需要一种方法来等待文本被更改。我不知道会出现什么文本,但我知道当前那里有什么文本。所以我想等待它在元素中消失。有办法吗? 最佳答案 你可以试试ExpectedCondi
自从我使用 Firefox 升级到 3.0 beta 后,我就有了这个异常(exception)。 Exception in thread "main" java.lang.IllegalStateE
任何人都可以帮助我使用 Selenium webdriver 截取整页屏幕截图。我正在使用 c#/Nunit。我正在使用的当前方法不是完整的浏览器页面。 我正在使用下面的代码截取屏幕截图。 publi
我通过 WebDriver (Chrome) 从网页下载图像 // STEP 1 $driver->get($link); // STEP 2 $els=$driver->findElements(W
Selenium WebDriver 的默认隐式等待值是什么? selenium 文档说它是“0”,但是当我在一个全新的项目上调用 .findElement 时,DOM 上不存在元素,它似乎在一段时间
我正在使用 Webdriver 测试 Web 应用程序,大致如下所述。当测试通过时,一切都很好。但是,当其中一个测试失败时,我注意到以下 2 个问题。 a) 如果一个测试失败,则套件中的其余测试将超时
我正在使用 Selenium WebDriver 并遇到问题。 在 UI 中,WebDriver 可以看到元素,但无法执行任何操作,例如单击、键入、选择等。元素由 selenium 找到并作为 web
我在 Java 中使用 Web 驱动程序处理 UntrustedSSLcertificates 时陷入困境。 我创建了 Firefox 配置文件,如: FirefoxProfile profile =
选择的编程语言是 Java。我已经用 Java 编写了一个方法,我将 WebDriver 作为参数传递给它... public boolean myMethod(WebDriver webDriver
我是一名优秀的程序员,十分优秀!