In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
The time code for launching ie browser in 1.selenium (in the red box) is as follows:
When you click run, the console reports an error as follows:
Started InternetExplorerDriver server (64-bit)
2.53.0.0
Listening on port 31574
Only local connections are allowed
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: 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)
Command duration or timeout: 692 milliseconds
Build info: version: '2.53.0mm, revision:' 35ae25bund, time: '2016-03-15 16V 5740'
System info: host: 'XL-20150414QGDQ', ip:' 192.168.80.6, os.name: 'Windows 7, os.arch:' amd64', os.version: '6.1, java.version:' 1.7.080'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
At sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
At sun.reflect.NativeConstructorAccessorImpl.newInstance (Unknown Source)
At sun.reflect.DelegatingConstructorAccessorImpl.newInstance (Unknown Source)
At java.lang.reflect.Constructor.newInstance (Unknown Source)
At org.openqa.selenium.remote.ErrorHandler.createThrowable (ErrorHandler.java:206)
At org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed (ErrorHandler.java:158)
At org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:678)
At org.openqa.selenium.remote.RemoteWebDriver.startSession (RemoteWebDriver.java:249)
At org.openqa.selenium.remote.RemoteWebDriver.startSession (RemoteWebDriver.java:234)
At org.openqa.selenium.ie.InternetExplorerDriver.run (InternetExplorerDriver.java:182)
At org.openqa.selenium.ie.InternetExplorerDriver. (InternetExplorerDriver.java:174)
At org.openqa.selenium.ie.InternetExplorerDriver. (InternetExplorerDriver.java:146)
At Project1Class.main (Project1Class.java:13)
Solution:
There are two solutions, one is to change the setting of IE, do not use protected mode (protected mode) under any circumstances, and the other is to set the Capabilities of IE at run time in the following snippet in the previous code.
The added code is as follows:
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer ()
IeCapabilities.setCapability (InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true)
WebDriver driver = new InternetExplorerDriver (ieCapabilities)
The error message can be found at the following address: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver.
The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html
two。 About the positioning method of the drop-down box:
Method 1: if the drop-down box is the native select of html, you can use the select method of selenium to locate it, but if it is a drop-down box developed by yourself, you cannot use this method.
Select selectCategory1 = new Select (driver.findElement (By.id ("category_1")
SelectCategory1.selectByVisibleText ("java")
Select selectCategory2 = new Select (driver.findElement (By.id ("category_2")
SelectCategory2.selectByVisibleText (3D Games)
Select selectCategory3 = new Select (driver.findElement (By.id ("difficulty")
SelectCategory3.selectByVisibleText ("intermediate")
Otherwise, the following error will be reported:
3. With regard to the positioning of the text box in the editor, we can not find any locatable elements, which need to be solved.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.