Ruby + watir cannot locate new window solution

Source: Internet
Author: User

Ruby 192 + watir 3.0.0

Today, I encountered a strange problem: Use watir: IE. attach in the script to locate a new ie window, and always report an error. error message:

Watir-classic-3.0.0/lib/watir-classic/ie-class.rb: 760: In 'rescue in attach_browser_window ': unable to locate a window with URL (? -Mix: Baidu.com) (watir: exception: nomatchingwindowfoundexception )"

The script does not execute my watir: IE. Attach () at all ().

1. Copy the ruby environment to the Windows 2003 + IE 7 Environment on another machine, in watir: IE. attach () in the previous step IE. link (: ID, 'kuaiyixie '). click to add IE. wait will be able to locate the new page, but it is always unavailable in my local environment, with IE. wait does not work either. Maybe it's a bad character.

In addition, in Windows 2003 + IE 7, the browser security enhancement problem may occur. Solution: DeleteProgram-In the add windows component window, remove the Security Configuration check in the browser,

2. Final Solution: Modify the startup method of IE and change watir: IE. New to watir: IE. new_process.

 

Nnd has been tossing around for almost a morning. In the afternoon, I accidentally saw this method on the Internet. In any case, it would be nice to solve the problem.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.