I NEED HELP SETTING UP SELENIUM FRAMEWORK

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

I NEED HELP SETTING UP SELENIUM FRAMEWORK

Postby mzaib » Fri Sep 14, 2018 11:31 am

we have a CEF based desktop windows application and i cant get it to launch through selenium, below is my java code, can anyone help/assist

Code: Select all
public class WindowSetUp {


        @Test
        public void testGoogleSearch() throws InterruptedException {
            // Optional, if not specified, WebDriver will search your path for chromedriver.
            System.setProperty("webdriver.chrome.driver", "C:/chromedriver.exe");
            ChromeOptions options = new ChromeOptions();
            options.setBinary("C:\\Users\\Muhammad Zaib\\AppData\\Roaming\\LiquidSky\\lib\\LiquidSkyV.exe.lnk");
            WebDriver driver = new ChromeDriver();
            driver.get("http://localhost:12388");




}
    }
mzaib
Newbie
 
Posts: 2
Joined: Fri Sep 14, 2018 11:28 am

Re: I NEED HELP SETTING UP SELENIUM FRAMEWORK

Postby magreenblatt » Fri Sep 14, 2018 2:11 pm

magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: I NEED HELP SETTING UP SELENIUM FRAMEWORK

Postby mzaib » Tue Sep 18, 2018 10:08 am

my current code


Code: Select all
     // Path to the ChromeDriver executable.
            System.setProperty("webdriver.chrome.driver", "C:\\Users\\Muhammad Zaib\\AppData\\Roaming\\LiquidSky\\chromedriver.exe");


           ChromeOptions options = new ChromeOptions();


            // Path to the CEF executable.
            File chromium = new  File ("C:\\Users\\Muhammad Zaib\\AppData\\Roaming\\LiquidSky\\LiquidSkyClient.exe");
           // ChromeOptions option = new ChromeOptions();
            options.setBinary(chromium);
        //   options.addArguments("remote-debugging-port=12388");
            options.addArguments("--headless", "--disable-gpu" , "--no-sandbox", "--show-me-cats-please=1");
            options.addArguments("--disable-dev-shm-usage");


            //    options.addArguments(" --show-me-cats-please=1");

            WebDriver driver = new ChromeDriver(options);
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            driver.get("http://localhost:12388");

        }




        static void sleep(int time) {
            try {
                Thread.sleep(time);
            } catch (InterruptedException e) {
            }
        }   }


the errors
Code: Select all
Starting ChromeDriver 2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5) on port 8239
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location C:\Users\Muhammad Zaib\AppData\Roaming\LiquidSky\LiquidSkyClient.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.52 seconds
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'DESKTOP-VBCSP1B', ip: '10.50.128.64', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '10.0.2'
Driver info: driver.version: ChromeDriver
   at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
   at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
   at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
   at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
   at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
   at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122)
   at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
   at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
   at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
   at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
   at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
   at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
   at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
   at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
   at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125)
   at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
   at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
   at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
   at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
   at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)
   at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
   at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
   at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
   at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157)
   at WindowSetUp.main(WindowSetUp.java:53)
mzaib
Newbie
 
Posts: 2
Joined: Fri Sep 14, 2018 11:28 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 51 guests