driver.getCurrentUrl()); don't write nothing at console

Not reproducible Issue #12131712

Details

Author
Anda C.
Created
May 25, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
14.14393
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

I have the test case written in Java, Selenium selenium-server-standalone-3.4.0.jar and MicrosoftWebDriver run locally

In my code I have System.out.println(driver.getCurrentUrl());
But when I ran my test don’t write nothing at console.

[20:34:58.448] - Listening on http://localhost:11550/

May 25, 2017 8:35:00 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
No such element (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.06 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.4.0’, revision: 'unknown’, time: ‘unknown’
System info: host: 'TERMINATOR’, ip: '192.168.1.109’, os.name: 'Windows 10’, os.arch: 'amd64’, os.version: '10.0’, java.version: ‘1.8.0_131’
Driver info: org.openqa.selenium.edge.EdgeDriver
Capabilities [{applicationCacheEnabled=true, pageLoadStrategy=normal, platform=ANY, acceptSslCerts=true, browserVersion=38.14393.1066.0, platformVersion=10, locationContextEnabled=true, webStorageEnabled=true, browserName=MicrosoftEdge, takesScreenshot=true, takesElementScreenshot=true, javascriptEnabled=true, platformName=windows}]
Session ID: C18D0016-1F2A-438C-8BE6-127F58562921
*** Element info: {Using=id, value=login-username}
[20:35:16.355] - Stopping server.

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

    • Hi Anda,

      You can use webDriver’s logging mechanism to get access to the browser’s console logs.  You could also get the console logs from a file, but that is less fancy. :-)

      https://github.com/SeleniumHQ/selenium/wiki/Logging

      Here is an example, it might be outdated, but the proper method will be similar:

      https://stackoverflow.com/questions/25431380/capturing-browser-logs-with-selenium

      Hope this helps,

      Steve

    • Here is my setup() method

      @Before
      public void setUp() throws Exception {
      System.setProperty("webdriver.edge.driver",
      “D:\Documentatie\Selenium\MicrosoftWebDriver.exe”);
      DesiredCapabilities capabilities = DesiredCapabilities.edge();
      capabilities.setCapability(CapabilityType.SUPPORTS_APPLICATION_CACHE,
      false);

          LoggingPreferences logPrefs = new LoggingPreferences();
          logPrefs.enable(LogType.BROWSER, Level.ALL);
          capabilities.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
      
          driver = new EdgeDriver(capabilities);
          driver.manage().window().maximize();
      }
      

      I run my test case from attachment and I receive:

      [10:14:20.864] - Listening on http://localhost:5985/

      May 26, 2017 10:14:40 AM org.openqa.selenium.os.UnixProcess checkForError
      SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)

      What would be the root cause of this error?

      I try to put platform to be Windows10.

      Stack trace is:
      org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
      Build info: version: '3.4.0’, revision: 'unknown’, time: ‘unknown’
      System info: host: 'TERMINATOR’, ip: '192.168.1.109’, os.name: 'Windows 10’, os.arch: 'amd64’, os.version: '10.0’, java.version: ‘1.8.0_131’
      Driver info: driver.version: EdgeDriver
      at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:193)
      at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:181)
      at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:78)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
      at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
      at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
      at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:137)
      at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:150)
      at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:118)
      at LogoutYahooMail.setUp(LogoutYahooMail.java:48)
      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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:5985/status] to be available after 20009 ms
      at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:107)
      at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:190)
      … 34 more
      Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
      at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:140)
      at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:80)
      … 35 more
      Caused by: java.util.concurrent.TimeoutException
      at java.util.concurrent.FutureTask.get(Unknown Source)
      at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:128)
      … 36 more

      java.lang.NullPointerException
      at LogoutYahooMail.tearDown(LogoutYahooMail.java:54)
      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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Thanks,

    • The second run of test case :

      [10:47:15.649] - Listening on http://localhost:13213/

      May 26, 2017 10:47:23 AM org.openqa.selenium.remote.ProtocolHandshake createSession
      INFO: Detected dialect: OSS
      No such element (WARNING: The server did not provide any stacktrace information)
      Command duration or timeout: 10.08 seconds
      For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
      Build info: version: '3.4.0’, revision: 'unknown’, time: ‘unknown’
      System info: host: 'TERMINATOR’, ip: '192.168.1.109’, os.name: 'Windows 10’, os.arch: 'amd64’, os.version: '10.0’, java.version: ‘1.8.0_131’
      Driver info: org.openqa.selenium.edge.EdgeDriver
      Capabilities [{applicationCacheEnabled=true, pageLoadStrategy=normal, platform=ANY, acceptSslCerts=true, browserVersion=38.14393.1066.0, platformVersion=10, locationContextEnabled=true, webStorageEnabled=true, browserName=MicrosoftEdge, takesScreenshot=true, takesElementScreenshot=true, javascriptEnabled=true, platformName=windows}]
      Session ID: E21199AD-8F54-4DAC-B4E7-353CCA75828F
      *** Element info: {Using=id, value=login-username}
      [10:47:43.369] - Stopping server.

      The same error after I put logging capabilities in my setup method.

      Thanks again.

    • Hi Anda,

      I want to verify if you are using Selenium Grid or local WebDriver.  I know you mentioned you were running locally but I see you mentioned selenium-server-standalone-3.4.0.jar.

      I suggest you try TestNG.  When you right click the test case and run it, the testing console window opens and you will see System.out.println output.  This example is using TestNG’s Reporter() class.

         @BeforeTest
          public void enableTestNGLogging(){
              Reporter.log( "Message", true );
          }
          @BeforeMethod
          public void launchBrowser() throws Exception {
              System.out.println(“launching Microsoft Edge browser”);
              System.setProperty(“webdriver.edge.driver", driverPath+"MicrosoftWebDriver.exe”);
              driver = new EdgeDriver();
              Reporter.log(“Browser Opened”);
          }

          @Test()
          public void openEdgeBrowser() throws Exception {
              driver.get(“http://demo.automationtesting.in/Windows.html”);
              Reporter.log(“driver.get();”);
              System.out.println("Opened URL: " + driver.getCurrentUrl());

      Test Execution Output:
      "
      Message
      launching Microsoft Edge browser
      [20:53:22.377] - Listening on http://localhost:14040/ 
      Jun 05, 2017 8:53:23 PM org.openqa.selenium.remote.ProtocolHandshake createSession
      INFO: Detected dialect: OSS
      Opened URL: http://demo.automationtesting.in/Windows.html
      "

      My original suggestion was for selenium Grid and for the output from the browser’s console, the F12 debugger console.

      You should be able to see the local Java bindings execution information without needing to set any special remote capabilities.  Sorry if I was wrong about using Grid.

      Steve

    • Ok, I will try suing TestNG.
      I am not using Selenium Grid.

    • Microsoft Edge Team

      Changed Status to “Not reproducible”

    • We have not been able to repro this on local webdriver instances, resolving as “not repro” for now until we get a more specific repro case (test page and script)

    You need to sign in to your Microsoft account to add a comment.

    Sign in