bonigarcia / webdrivermanager

Automated driver management and other helper features for Selenium WebDriver in Java
https://bonigarcia.dev/webdrivermanager/
Apache License 2.0
2.58k stars 677 forks source link

WebDriverManager.edgedriver().setup() fails with NoSuchElementException #338

Closed ajoecker closed 5 years ago

ajoecker commented 5 years ago

Hi,

I am using webdrivemanager v3.4.0 and try to initialise the EdgeDriver by calling

WebDriverManager.edgedriver().setup();
EdgeDriver edgeDriver = new EdgeDriver();
edgeDriver.get("http://www.google.de");

this fails with

Exception in thread "main" io.github.bonigarcia.wdm.WebDriverManagerException: java.util.NoSuchElementException
    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:715)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:712)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
    at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:260)
    at de.end2end.browser.interaction.Browser.main(Browser.java:104)
Caused by: java.util.NoSuchElementException
    at java.base/java.util.LinkedList$ListItr.next(LinkedList.java:894)
    at io.github.bonigarcia.wdm.EdgeDriverManager.postDownload(EdgeDriverManager.java:155)
    at io.github.bonigarcia.wdm.Downloader.extract(Downloader.java:202)
    at io.github.bonigarcia.wdm.Downloader.downloadAndExtract(Downloader.java:138)
    at io.github.bonigarcia.wdm.Downloader.download(Downloader.java:81)
    at io.github.bonigarcia.wdm.WebDriverManager.downloadCandidateUrls(WebDriverManager.java:723)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:536)
    ... 4 more

when debugging this, it looks like that the candidate urls work differently.

In io.github.bonigarcia.wdm.WebDriverManager#filterCandidateUrls, the following List<URL> is returned:

[https://msedgecdn.azurewebsites.net/webdriver/index.html]

This is for Release 75. This link messes up all following assumptions of downloading a driver

Possible earlier releases like Release 17134 seems to have a correct url https://download.microsoft.com/download/F/8/A/F8AF50AB-3C3A-4BC4-8773-DC27B32988DD/MicrosoftWebDriver.exe, but I cannot use

WebDriverManager.edgedriver().version("17134").setup();
EdgeDriver edgeDriver = new EdgeDriver();
edgeDriver.get("http://www.google.de");

as this fails with

Exception in thread "main" io.github.bonigarcia.wdm.WebDriverManagerException: io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver 17134 for WIN64 not found in https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:715)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:712)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
    at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:260)
    at de.end2end.browser.interaction.Browser.main(Browser.java:104)
Caused by: io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver 17134 for WIN64 not found in https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:533)
    ... 4 more

Is this an issue or do I have a wrong configuration ?

bonigarcia commented 5 years ago

There were problems with Edge in former version of WebDriverManager. I have recently released version 3.5.0, which in theory solved these issues. Please update to that version.

cseeegraef commented 5 years ago

hi, using webdrivermanager 3.6.0 and edge Version 76.0.172.0 (Official build) dev (64-bit) produces same error.

bonigarcia commented 5 years ago

The format of the page releasing eddriver binaries has changed again, and as result, the support for Edge is broken again. I will to fix for the next release of WebDriverManager.

bonigarcia commented 5 years ago

This should be fixed in version 3.6.1, recently released.

Naumansh commented 5 years ago

@bonigarcia

not fixed for edge. Used like WebDriverManager.edgedriver().forceDownload().setup();

Below is the stack trace

io.github.bonigarcia.wdm.WebDriverManagerException: java.lang.ArrayIndexOutOfBoundsException at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:723) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:548) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:720) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:548) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:260) at eyethink.automation.bots.controller.EdgeManager.setupController(EdgeManager.java:34) at eyethink.automation.bots.controller.TestSetupController.runBrowser(TestSetupController.java:211) at eyethink.automation.bots.controller.TestSetupController.initializer(TestSetupController.java:99) at com.ggproduct.automation.steps.setup.startUp(setup.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at cucumber.runtime.Utils$1.call(Utils.java:40) at cucumber.runtime.Timeout.timeout(Timeout.java:16) at cucumber.runtime.Utils.invoke(Utils.java:34) at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60) at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:224) at cucumber.runtime.Runtime.runHooks(Runtime.java:212) at cucumber.runtime.Runtime.runBeforeHooks(Runtime.java:202) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:40) at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165) at cucumber.api.testng.TestNGCucumberRunner.runCucumber(TestNGCucumberRunner.java:63) at cucumber.api.testng.AbstractTestNGCucumberTests.feature(AbstractTestNGCucumberTests.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124) at org.testng.internal.Invoker.invokeMethod(Invoker.java:583) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ArrayIndexOutOfBoundsException

remcogeldhof commented 5 years ago

@Naumansh I have the same issue.

Naumansh commented 5 years ago

@remcogeldhof I have almost tried everything but i think there is some issue with the implementation of this new version as array out of index suggests there is some memory leakage in webDriverManager code.

karlareyes16 commented 5 years ago

Hi @bonigarcia , just wanna ask is this something to be fixed soon? or if you have an earlier version that's working and can be used at the moment? Thanks

bonigarcia commented 5 years ago

@karlareyes16 It is already solved in the master branch. I plan to release a new version this week.

bonigarcia commented 5 years ago

Solved in release 3.6.2, just released.

DeepKandey commented 5 years ago

it is not solved yet. Still, we are getting the error while launching Microsoft Webdriver

daskhatri commented 4 years ago

Agree with @DeepKandey , still it is not working. I downloaded the server, unpacked and followed the commands given on Get started page for windows 10. Is there any other way to get this fix like some explicit fetch or changes in version some where in configuration file or source code?

DeepKandey commented 4 years ago

@daskhatri

  1. Run below command on elevated command Prompt:- DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
  2. Write below command to launch edge browser for Java language binding:- EdgeDriverService service = EdgeDriverService.createDefaultService(); WebDriver driver = new EdgeDriver(service);
thepratikmankar commented 4 years ago

I'm having a below issue when I'm trying to run the Chromium Edge Browser with the WebDriverManager.

Could someone help me figure out what could be an issue here?

Error Log: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/Admin/.m2/repository/org/slf4j/slf4j-simple/1.6.6/slf4j-simple-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/Admin/.m2/repository/org/slf4j/slf4j-nop/1.5.3/slf4j-nop-1.5.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/Admin/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory] 791 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using msedgedriver pre-installed (since Microsoft Edge 44 is installed in your machine) 793 [main] ERROR io.github.bonigarcia.wdm.WebDriverManager - There was an error managing msedgedriver pre-installed (MicrosoftWebDriver.exe should be pre-installed in an elevated command prompt executing: dism /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0) io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver.exe should be pre-installed in an elevated command prompt executing: dism /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0 at io.github.bonigarcia.wdm.WebDriverManager.checkPreInstalledVersion(WebDriverManager.java:634) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:523) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:260) at com.qa.CBI.browser.edge.EdgeBrowser.cloudEdgeBrowser(EdgeBrowser.java:36) at com.qa.CBI.browser.edge.EdgeBrowser.main(EdgeBrowser.java:58) Exception in thread "main" io.github.bonigarcia.wdm.WebDriverManagerException: io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver.exe should be pre-installed in an elevated command prompt executing: dism /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0 at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:754) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:563) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:260) at com.qa.CBI.browser.edge.EdgeBrowser.cloudEdgeBrowser(EdgeBrowser.java:36) at com.qa.CBI.browser.edge.EdgeBrowser.main(EdgeBrowser.java:58) Caused by: io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver.exe should be pre-installed in an elevated command prompt executing: dism /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0 at io.github.bonigarcia.wdm.WebDriverManager.checkPreInstalledVersion(WebDriverManager.java:634) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:523) ... 3 more

DeepKandey commented 4 years ago

Use normal Edge driver from Windows portal. It will work

Naumansh commented 4 years ago

yes it works but since we use webdriver manager so we need it as part of out configuration instead of downlaoding it separately.

himanshusoni30 commented 4 years ago

I am facing this issue while launching EdgeDriver through WebDriverManager. Could you please resolve this issue.

io.github.bonigarcia.wdm.config.WebDriverManagerException: io.github.bonigarcia.wdm.config.WebDriverManagerException: msedgedriver 83.0.478.45 for WIN 64 not found in https://msedgedriver.azureedge.net/ at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:725) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:531) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:722) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:531) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:277) at com.applitools.hackathon.ufg.test.BaseTests.openBrowser(BaseTests.java:94) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216) at org.testng.internal.Invoker.invokeMethod(Invoker.java:590) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1137) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:753) at org.testng.TestRunner.run(TestRunner.java:607) at org.testng.SuiteRunner.runTest(SuiteRunner.java:368) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:363) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:321) at org.testng.SuiteRunner.run(SuiteRunner.java:270) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1284) at org.testng.TestNG.runSuitesLocally(TestNG.java:1209) at org.testng.TestNG.runSuites(TestNG.java:1124) at org.testng.TestNG.run(TestNG.java:1096) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81) Caused by: io.github.bonigarcia.wdm.config.WebDriverManagerException: msedgedriver 83.0.478.45 for WIN 64 not found in https://msedgedriver.azureedge.net/ at io.github.bonigarcia.wdm.WebDriverManager.noCandidateUrlFound(WebDriverManager.java:607) at io.github.bonigarcia.wdm.WebDriverManager.createUrlHandler(WebDriverManager.java:756) at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:593) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:525) ... 31 more

bonigarcia commented 4 years ago

@himanshusoni30 This is a closed issue, not related to that error. Please open a new issue about it.

ShenkiSinghai commented 1 year ago

@bonigarcia I am still facing this issue in 3.8.1