Watir-webdriver:Chrome 在 IE 和 Firefox 工作正常的网站上出现未处理的错误

发布于 2024-12-02 05:42:49 字数 1119 浏览 2 评论 0原文

所以我认为这可能是 ChromeDriver 的错误,但想先在这里问一下。

我在使用 chrome 时遇到了几乎所有 webdriver 功能的问题,但 IE 和 Firefox 工作正常。

该站点是 www.bing.com 的 Windows Live 登录站点。

<一href="https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1314808262&rver=6.0.5286.0&wp=MBI&w回复=http:%2F%2Fwww.bing.com%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252f&lc=1033&id=264960" rel="nofollow">https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1314808262&rver=6.0.5286.0&wp=MBI&am p;wreply=http:%2F%2Fwww.bing.com%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252f&lc=1033&id=264960

一旦到达该网站,当使用 Chrome 时,我唯一可以正常工作的两个功能是

@browser.title
@browser.html 

唯一可以正常工作的功能。当我尝试时,

@browser.links.size
@browser.button[0].flash
@browser.button[0].click 

我得到

Selenium::WebDriver::Error::UnhandledError:

Using :id etc to reference the object 也不起作用。

不过 IE 和 Firefox 可以与该网站正常交互。

如果您需要代码或说明,请告诉我,但基本上我无法让 chrome 与该登录站点进行交互。 (其他网站在 Chrome 上运行得很好)

So I think this might be an error with the ChromeDriver but wanted to ask here first.

I'm having trouble using just about every webdriver function with chrome, yet IE and Firefox is working fine.

The site is www.bing.com's sign in with Windows live site.

https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1314808262&rver=6.0.5286.0&wp=MBI&wreply=http:%2F%2Fwww.bing.com%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252f&lc=1033&id=264960

Once at that site when using chrome the only two functions I can get to work properly are

@browser.title
@browser.html 

are the only functions that work properly. When I try

@browser.links.size
@browser.button[0].flash
@browser.button[0].click 

I get

Selenium::WebDriver::Error::UnhandledError:

Using :id etc to reference the objects doesn't work either.

However IE and Firefox can interact with the site fine.

If you need code or clarification let me know, but basically I can't get chrome to interact with that log in site. (Other sites work just fine on chrome)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独患者 2024-12-09 05:42:49

您需要安装 ChomeDriver,这涉及下载二进制文件并将其放在您的 PATH 中。请参阅:http://watirwebdriver.com/chrome/

这个网站在 Chrome 中非常适合我。

例如。

$irb
ruby-1.9.2-p290 :001 > require 'watir-webdriver'
 => true 
ruby-1.9.2-p290 :002 > b = Watir::Browser.new :chrome
 => #<Watir::Browser:0x6c6e06ba1a564e50 url="about:blank" title="about:blank"> 
ruby-1.9.2-p290 :003 > b.goto "https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1314808262&rver=6.0.5286.0&wp=MBI&wreply=http:%2F%2Fwww.bing.com%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252f&lc=1033&id=264960"
 => "https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1314808262&rver=6.0.5286.0&wp=MBI&wreply=http:%2F%2Fwww.bing.com%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252f&lc=1033&id=264960" 
ruby-1.9.2-p290 :004 > b.title
 => "Welcome to Windows Live" 
ruby-1.9.2-p290 :005 > b.html
 => "<!-- ServerInfo: BAYIDSLGN1M37 2011.07.22.19.28.58...

You will need to install the ChomeDriver, which involves downloading the binary and putting it on your PATH. See: http://watirwebdriver.com/chrome/

This site works perfectly for me in Chrome.

Eg.

$irb
ruby-1.9.2-p290 :001 > require 'watir-webdriver'
 => true 
ruby-1.9.2-p290 :002 > b = Watir::Browser.new :chrome
 => #<Watir::Browser:0x6c6e06ba1a564e50 url="about:blank" title="about:blank"> 
ruby-1.9.2-p290 :003 > b.goto "https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1314808262&rver=6.0.5286.0&wp=MBI&wreply=http:%2F%2Fwww.bing.com%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252f&lc=1033&id=264960"
 => "https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1314808262&rver=6.0.5286.0&wp=MBI&wreply=http:%2F%2Fwww.bing.com%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252f&lc=1033&id=264960" 
ruby-1.9.2-p290 :004 > b.title
 => "Welcome to Windows Live" 
ruby-1.9.2-p290 :005 > b.html
 => "<!-- ServerInfo: BAYIDSLGN1M37 2011.07.22.19.28.58...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文