0

I'm trying to extract this information from the log in my Selenium tests but it doesn't seem to be able to be extracted and used as a string. I have:

System.setProperty("webdriver.chrome.verboseLogging", "true");

and I've been trying to get printouts using each Log type (DEBUG doesn't seem to be available to me)

    System.out.println("Type: Profiler");
    Logs logs1 = driver.manage().logs();
    LogEntries logEntries = logs1.get(LogType.PROFILER);

    for (LogEntry logEntry : logEntries) {
        System.out.println("The LOGS" + logEntry.getMessage());
    }

[1619452557.549][DEBUG]: DevTools WebSocket Event: Runtime.consoleAPICalled

The logs I'm trying to exact the string from is:

0E9326DE323701D066C1C9D82CF5E852 {
"args": [ {
  "type": "string",
  "value": "OPENING noting://launch? iss=https%3A%2F%2Fs.com%2Fimsauth%2Ffhir&launch=%7B%22authToken%22%3A%22eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMTU5IiwiaWF0IjoxNjE5NDUyNDg3LCJleHAiOjE..."
} ]

I'm trying to get the "value" and return it as a string

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
user9686029
  • 252
  • 1
  • 2
  • 11
  • Does this answer your question? [Getting a substring from a string after a particular word](https://stackoverflow.com/questions/25225475/getting-a-substring-from-a-string-after-a-particular-word) – maio290 Apr 26 '21 at 16:06
  • No i know how o do that i just need to extract that exact log file – user9686029 Apr 26 '21 at 16:08

0 Answers0