Tag: watir webdriver

初始watir-webdriver启动后边缘浏览器崩溃

我正在使用最新的selenium-webdriver(2.47.1)和watir-webdriver(0.8.0),并将Edge WebDriver安装在Ruby / bin文件夹中,就像其他webdriver.exe文件一样; 像chromedriver或iedriver。 它似乎启动了Edge浏览器,但在关闭浏览器并且未通过所有测试之前不会尝试转到URL。 我在Windows中的防火墙允许它,当我运行我的rspec测试时它指出: Selenium::WebDriver::Error::NoSuchWindowError: no such window 有没有人让MSWebdriver与watir-webdriver一起工作? 错误: c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/response.rb:71:in `assert_ok’: not implemented (Selenium::WebDriver::Error::WebDriverError) from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/response.rb:34:in `initialize’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/http/common.rb:78:in `new’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/http/common.rb:78:in `create_response’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/http/default.rb:90:in `request’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/http/common.rb:59:in `call’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/bridge.rb:657:in `raw_execute’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/bridge.rb:635:in `execute’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/bridge.rb:221:in `switchToDefaultContent’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/common/target_locator.rb:96:in `default_content’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:385:in `assert_exists’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:110:in `url’ from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:79:in `goto’ from […]

如何使用watir访问标签

我正在尝试通过watir撰写电子邮件。 因此,当我尝试访问它时,它具有标记。 任何人都可以建议如何访问它? 我的系统配置 IE-8Inter code here Windows-7 我做了以下 require ‘rubygems’ require ‘watir’ @ie.text_field(:id,’:13r’).set ‘sample’ HTML CODE CSSSTYLEsheet 我试图以文本框的forms访问它,因为“role”属性的值为“textbox”。 我得到了错误:274: assert_not_readonly’ from C:/svn/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/input_elem ents.rb:368:in set’中的assert_not_readonly’ from C:/svn/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/input_elem ents.rb:368:in ‘

如何使用Watir 6.0下载文件

我正在尝试使用新的Watir 6.0下载CSV文件。 我找到了Firefox的配置文件设置: profile = Selenium::WebDriver::Firefox::Profile.new profile[‘browser.download.folderList’] = 2 profile[‘browser.download.dir’] = path_to_download profile[‘browser.helperApps.neverAsk.saveToDisk’] = “text/csv” browser = Watir::Browser.new :firefox, :profile => profile 但Firefox 50.0不支持加载配置文件设置。 我收到此错误消息: /var/lib/gems/2.3.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/remote/w3c_bridge.rb:80:in `initialize’: unknown option: {:profile=>#<Selenium::WebDriver::Firefox::Profile 我还尝试了Chrome的配置文件设置: profile = Selenium::WebDriver::Chrome::Profile.new profile[‘download.prompt_for_download’] = false profile[‘download.default_directory’] = path_to_download browser = Watir::Browser.new :chrome, :profile => Profile 但文件将不会保存,文件保存对话框也不会关闭。 所以两者都不适用于新的Watir。 有没有人知道用Watir下载文件的方法?

watir-webdriver在保持浏览器打开的同时更改代理

我在Ruby中使用Watir-Webdriver库来检查一些页面。 我知道我可以使用代理连接 profile = Selenium::WebDriver::Firefox::Profile.new#create a new profile profile.proxy = Selenium::WebDriver::Proxy.new(#create proxy data for in the profile :http => proxyadress, :ftp => nil, :ssl => nil, :no_proxy => nil ) browser = Watir::Browser.new :firefox, :profile => profile#create a browser window with this profile browser.goto “http://www.example.com” browser.close 但是,当想要使用不同的代理多次连接到同一页面时,我必须为每个代理创建一个新的浏览器。 加载(和卸载)浏览器需要相当长的时间。 所以,我的问题: 有没有办法改变,使用ruby中的webdriver,Firefox使用代理地址连接,同时保持浏览器打开?

Selenium WebDriver将Firefox路径更改为Tor

我正在尝试更改ruby中的webdriver来打开一个浏览器而不是默认的firefox broswer。 我正在使用以下代码,并且在运行此代码之前打开了浏览器。 path=’C:\Users\Bonnnie\Downloads\Tor Browser\App\tor.exe’ Selenium::WebDriver::Firefox.path = path driver = Selenium::WebDriver.for :firefox 我收到以下错误: unable to obtain stable firefox connection in 60 seconds 我想我可能会链接到错误的tor文件。

watir打印/放置所有可见链接

$browser.links.each do |link| puts link.attribute_value(“class”) end 如何获取put语句中的所有可见/现有链接?

如何根据行中的文本单击表中的链接

使用page-object和watir-webdriver如何根据行文本单击表中的链接,如下所示: 该表包含3行,其中第一列中包含名称,右侧列中包含相应的“详细信息”链接: 仪表板….详情 示例……细节 等等。 ALL THE DETAILS: ….soon DASHBOARD: —> Based on this text ….some element Details —> I should able click this link

Watir Web驱动程序下载文件

我正在编写Ruby脚本以自动化使用Watir Web驱动程序从文件列表下载文件。 自动弹出窗口和目录选择器以将文件保存到某个位置的任何指针或方法? 谢谢。

将图像保存在watir-webdriver中

我需要将图像从recaptcha保存到localhost磁盘,我使用watir-webdriver获取图像dom元素,但它不支持save方法,就像watir一样。 那么如何将图像保存到我的磁盘? HTML: 和ruby代码: cap = @browsers[i].div(:id => ‘recaptcha_image’).image 如何将图像文件保存到磁盘?

是否有镀铬开关来抑制“外部协议请求”?

是否有镀铬开关来抑制“外部协议请求”? 我正在使用selenium – ruby​​ – watir webdriver自动化应用程序。 我在网上搜索了绕过此窗口和对话的解决方案: http : //productforums.google.com/forum/#!topic/chrome/K22hXwRy6zQ概述了我们如何手动执行此操作。 但对于Selenium-Chrome-Ruby,我需要通过设置chrome开关来实现这一点(chorme开关列表:= http://src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc ) 。 这是一个巨大的清单。 我需要帮助找出哪个开关可能会帮助我绕过外部协议请求窗口,或者通过自动化有什么解决方法?