3
votes

I am very new in using selenium java. I went through with the online tutorial and ran a simple program to test if a page is successfully open or not.

I am not sure why these error message happened. Since I copied & pasted code from the online tutorial.

Please help!,I don't understand what goes wrong..

----The program----

package seleniumPrograms;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
public class Gecko_Driver {
 
    public static void main(String[] args) throws InterruptedException {
        System.setProperty("webdriver.gecko.driver","C:\\Users\\bm-toshiba5\\Softwares\\geckodriver-v0.11.1-win64\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        driver.get("http://www.toolsqa.com");
 
        Thread.sleep(5000);
        driver.quit();
    }
}

----The Error Messages ----

1477634165078 geckodriver INFO Listening on 127.0.0.1:15694 Oct 28, 2016 4:56:05 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end 1477634165633 mozprofile::profile INFO Using profile path C:\Users\BM-TOS~1\AppData\Local\Temp\rust_mozprofile.lCCcXFkfXvty 1477634165646 geckodriver::marionette INFO Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe 1477634166149 geckodriver::marionette INFO Connecting to Marionette on localhost:53137 1477634167869 Marionette INFO Listening on port 53137 1477634170473 Marionette INFO startBrowser 2e5153b8-f5ad-4d7b-b974-d8ae27ba7b71 Oct 28, 2016 4:56:10 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C [Child 9388] WARNING: pipe error: 232: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 513 [Child 9388] ###!!! ABORT: Aborting on channel error.: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, line 2052

!!! [Child][MessageChannel] Error: (msgtype=0xFA0005,name=PTexture::Msg_Destroy) Channel error: cannot

send/recv

!!! [Child][MessageChannel] Error: (msgtype=0xFA0005,name=PTexture::Msg_Destroy) Channel error: cannot

send/recv

!!! [Child][MessageChannel] Error: (msgtype=0xFA0005,name=PTexture::Msg_Destroy) Channel error: cannot

send/recv

!!! [Child][MessageChannel] Error: (msgtype=0xFA0005,name=PTexture::Msg_Destroy) Channel error: cannot

send/recv

!!! [Child][MessageChannel] Error: (msgtype=0x400003,name=PCompositable::Msg_Destroy) Channel error:

cannot send/recv

.....

Oct 28, 2016 4:56:28 PM org.openqa.selenium.os.UnixProcess destroy SEVERE: Unable to kill process with PID 5288

1

1 Answers

5
votes

You are using drive.quit() instead of driver.close(). quit closes the driver and window. This is why you get the child error because the driver is no longer available. close(), will close the window but keep the driver alive. I would only use quit at the very end of your program (like a cleanup routine). I ran your code (modified below) on my machine and did not have any errors. Also, you should put this around a try/catch so that you can see what is going on. I found with selenium that the try/catch sometimes shows errors that your console does not show. I had something similar with an earlier project and the try catch assisted with debugging.

package com.kurt.stackoverflow.selenium;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Gecko_Driver
{
    public static void main(String[] args) throws InterruptedException{

    try
    {
       System.setProperty("webdriver.gecko.driver","C:\\tmp\\geckodriver-v0.11.1-win64\\geckodriver.exe");
       WebDriver driver = new FirefoxDriver();
       driver.get("http://www.toolsqa.com");
       Thread.sleep(5000);
       driver.close();
    }
    catch (Exception e)
    {
       System.out.println("Caught message " + e.getMessage());
       driver.close();
    }
}

}