LogEntries logEntries = logs.get(LogType.DRIVER); not implemented

Duplicate Issue #12338339 • See Issue #12238249

Details

Author
Anda C.
Created
Jun 14, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Duplicates
See progress on Bug #12238249
Found in build #
14.14393
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

I have the code:

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package edgedriverbestjobs1;

import java.net.MalformedURLException;
import java.util.Set;
import java.util.logging.Level;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.logging.LogEntries;
import org.openqa.selenium.logging.LogEntry;
import org.openqa.selenium.logging.LogType;
import org.openqa.selenium.logging.LoggingPreferences;
import org.openqa.selenium.logging.Logs;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class SearchJobBestJobs_1 {

private static WebDriver driver;


public static void main(String[] args) throws MalformedURLException {
    // TODO code application logic here

    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);
    logPrefs.enable(LogType.CLIENT, Level.ALL);
    logPrefs.enable(LogType.DRIVER, Level.ALL);
    logPrefs.enable(LogType.SERVER, Level.ALL);
    logPrefs.enable(LogType.PERFORMANCE, Level.ALL);

    capabilities.setCapability(CapabilityType.LOGGING_PREFS,
            logPrefs);

    capabilities.setCapability("browser", "Edge");
    capabilities.setCapability("acceptSslCerts", true);
    capabilities.setCapability(CapabilityType.PAGE_LOAD_STRATEGY,
            "eager");
    //Set<String> logs = driver.manage().logs().getAvailableLogTypes();

    //System.out.println(logs.size());

    /*
    for(String log: logs)
    {
        System.out.println(log);
    }
     */
    capabilities.setCapability("os", "Windows");
    capabilities.setCapability("os_version", "10");

    driver = new EdgeDriver(capabilities);

    driver.manage().window().maximize();
    driver.get("https://www.bestjobs.eu/ro/");

    By bySeach = By.id("keyword");
    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(ExpectedConditions.presenceOfElementLocated(bySeach));
    WebElement anchSignIn = driver.findElement(bySeach);
    anchSignIn.sendKeys("tester");

    WebElement btnSearch = driver.findElement(By.className("btn btn-block btn-sm btn-default-success btn-search amplitude"));
    btnSearch.click();

    driver.switchTo().activeElement();

    By byTitle = By.tagName("h1");
    WebDriverWait wait1 = new WebDriverWait(driver, 10);
    wait.until(ExpectedConditions.presenceOfElementLocated(byTitle));
    WebElement title = driver.findElement(byTitle);
    System.out.println(title.getText());

    Logs logs = driver.manage().logs();
    LogEntries logEntries = logs.get(LogType.DRIVER);

    for (LogEntry logEntry : logEntries) {
        System.out.println(logEntry.getMessage());
    }

    //driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
    //driver.quit();
}

}

Here I my console after running:

run:
[15:25:05.379] - Listening on http://localhost:22213/
Jun 14, 2017 3:25:12 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Navighează printre ofertele de job
Exception in thread “main” org.openqa.selenium.WebDriverException: Not implemented (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 22 milliseconds
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: DA422878-2E32-40F3-8BFE-9540F4562BD1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671)
at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:35)
at org.openqa.selenium.remote.RemoteLogs.getRemoteEntries(RemoteLogs.java:81)
at org.openqa.selenium.remote.RemoteLogs.get(RemoteLogs.java:77)
at edgedriverbestjobs1.SearchJobBestJobs_1.main(SearchJobBestJobs_1.java:98)

C:\Users\andad\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 40 seconds)

At line 98 said:

Exception in thread “main” org.openqa.selenium.WebDriverException: Not implemented (WARNING: The server did not provide any stacktrace information)

How to get logs?

Thanks

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

    • Hi Anda,

      This is a known issue.   WebDriver currently does not support the JSON wire protocol’s log API.  You can see the current status and plans for log API support at the following URL:

      https://docs.microsoft.com/en-us/microsoft-edge/webdriver-commands

      GET    /session/:sessionId/log    Not Supported    Priority 3
      GET    /session/:sessionId/log/types    Not Suppo

      I will duplicate your bug report to the other:

      https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12238249/

      Also, a partial workaround is to use TestNGLogging as mentioned in the bug report I am duplicating this to.  I am reviewing what logging capabilities do not have workarounds and will update the active bug report.

      Appreciate the submission and the continued support.  Keep the submissions coming. :)

      Steve

    • Microsoft Edge Team

      Changed Status to “Duplicate”

    • This bug has marked as duplicate. Please follow the parent issue to get new updates.

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

    Sign in