Today, we studied the next IE, Chrome, firefox browser execution script
1. First Firefox execution, I was installed on the D drive, so to change the path
If Firefox is not installed by default on the C drive, you need to set its path
System.setproperty ("Webdriver.firefox.bin", "D:/softwareinstallation/huohu/firefox.exe");
Webdriver Driver = new Firefoxdriver ();
2. When executing under Chrome, the following issues are encountered
Exception in thread ' main ' java.lang.IllegalStateException:The path to the driver executable must is set by the Webdriver . Chrome.driver system property; For more information, see Http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can downloaded from http://code.google.com/p/chromedriver/downloads/list
Workaround:
Download the chrome driver plug-in, (including IE driver plugin), the code is as follows, and if you have a question, add the path to the PATH variable
HTTP://YUNPAN.CN/C3KPMJTZDDLYV Access Password 4dd5
1 // Google Chrome 2 system.setproperty ("Webdriver.chrome.driver", "c:\\users\\administrator\\desktop\\testzidong\\ Selenium\\anzhuangbao\\chromedriver_win32\\chromedriver.exe "); 3 webdriver driver=new chromedriver (); 4
3. The above type issue occurs when running under IE. The solution is ibid.
The code is as follows:
1 system.setproperty ("Webdriver.ie.driver", "c:\\users\\administrator\\desktop\\testzidong\\selenium\\ Anzhuangbao\\iedriverserver_x64_2.48.0\\iedriverserver.exe "2 new Internetexplorerdriver ();
But there are other errors in the run-time package.
Here's how to do this: get all the safe areas of IE options on the hook
Selenium Learning Notes---novice learning record (2) Summary of the problem