Selenium driven browser code in Java programming language
•
Java
Selenium 3 is used here Version 7,
Summarize the following precautions:
1. Set the driver path of each browser
System.setProperty("","");
2. Create a browser object
WebDriver driver = new xxx();
1. Drive IE browser
The drivers of IE browser are 32-bit and 64 bit. It is recommended to use 32-bit iedriver because 64 bit ie driver is too slow.
Note that the ie protection mode is disabled in all States. As shown in the screenshot below, under the four modes, the protection mode is not checked.
main(String args[]) System.setProperty("webdriver.ie.driver",".\\Tools\\IEDriverServer.exe" WebDriver driver = driver.get("http://www.baidu.com" String s = driver.manage().timeouts().implicitlyWait(10 Thread.sleep(1000 }
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码