0
votes

I get a warn message when I try this code but the test case execute successfully.

Code

package test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class teatcalss {

public static void main(String[] args) {
    // declaration and instantiation of objects/variables
      System.setProperty("webdriver.gecko.driver", "D:\\java\\geckodriver-v0.14.0-win64\\geckodriver.exe");

    WebDriver driver = new FirefoxDriver();
    String baseUrl = "http://newtours.demoaut.com";
    String expectedTitle = "Welcome: Mercury Tours";
    String actualTitle = "";

    // launch Firefox and direct it to the Base URL
    driver.get(baseUrl);

    // get the actual value of the title
    actualTitle = driver.getTitle();

    /*
     * compare the actual title of the page witht the expected one and print
     * the result as "Passed" or "Failed"
     */
    if (actualTitle.contentEquals(expectedTitle)){
        System.out.println("Test Passed!");
    } else {
        System.out.println("Test Failed");
    }

    //close Firefox
    driver.close();

    // exit the program explicitly
    System.exit(0);
}
}

Warning message

1486664295999 geckodriver INFO Listening on 127.0.0.1:44072 Feb 09, 2017 10:18:16 AM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 1486664297761 mozprofile::profile INFO Using profile path C:\Users\Radwa\AppData\Local\Temp\rust_mozprofile.DhhwmmiiHibT 1486664297779 geckodriver::marionette INFO Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe 1486664297822 geckodriver::marionette INFO Connecting to Marionette on localhost:10262 [GFX1-]: CreateShaderResourceView failed for format87 1486664301804 Marionette INFO Listening on port 10262 [GFX1-]: CreateShaderResourceView failed for format87 Feb 09, 2017 10:18:29 AM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C Test Passed!

2
And what is your question? - Grzegorz Górkiewicz

2 Answers

0
votes

This is a known message. See here for more info and discussion.

Bottom line, it's not an error, it won't break anything. If something gets screwed up, then that's when it's a good time to investigate. As it is right now, you can safely ignore it.

0
votes

You can use the below code with your scripts, which will redirects these low level logs to a separate file rather than the console -

System.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE,"true");
System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,"C:\\temp\\logs.txt");

For more information, you check refer this article - Disable Firefox logs