public synchronized void fetchAndStoreLogsFromDriver ( SessionId sessionId , WebDriver driver ) throws IOException { if ( ! perSessionDriverEntries . containsKey ( sessionId ) ) { perSessionDriverEntries . put ( sessionId , new HashMap <> ( ) ) ; } Map < String , LogEntries > typeToEntriesMap = perSessionDriverEntries . get ( sessionId ) ; if ( storeLogsOnSessionQuit ) { typeToEntriesMap . put ( LogType . SERVER , getSessionLog ( sessionId ) ) ; Set < String > logTypeSet = driver . manage ( ) . logs ( ) . getAvailableLogTypes ( ) ; for ( String logType : logTypeSet ) { typeToEntriesMap . put ( logType , driver . manage ( ) . logs ( ) . get ( logType ) ) ; } } }
Fetches and stores available logs from the given session and driver .