Selenium cannot start IE

Source: Internet
Author: User

Supported classes to be imported:

Code to start IE browser:

System. setproperty ("WebDriver. ie. Driver", iedriverserver.exe storage path );
WebDriver driver = new internetexplorerdriver ();
Driver. Get ("http://www.baidu.com ");

Driver. Quit (); // close the browser

If the code above prompts an error similar to the following:

If the preceding error message is displayed, it indicates that the environment is faulty. In this case, check whether the required jar package has been added to the project. If not, copy all the jar packages (including the selenium-jar-x.x.x and libs Directories) in the WebDriver directory, right-click and paste on the project, and then check whether these packages have been imported into the project, if no, right-click the project: properties-> JAVA build path-> library, and then respond to 'add jar' in the interface ', add all the copied jar packages to the project.

If you still cannot start IE after completing all the preceding operations, and an exception similar to the following error is reported in thread "main" Org. openqa. selenium. webdriverexception: Unexpected error launching Internet Explorer. protected Mode settings are not the same for all zones. enable protected mode must be set to the same value (enabled or disabled) for all zones. (warning: the server did not provide any stacktrace Information)
System Info: OS. name: 'windows 7', OS. arch: 'amd64', OS. version: '6. 1', Java. version: '1. 7.0 _ 25 ′

The consideration is that the IE security level is too high. The solution is to set the security level to the lowest in the Internet option and deselect the 'Enable protection mode' check;

After completing the above operations, ie will be able to start smoothly.

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.