CEF Client with embedded Chrome subprocesses

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.

CEF Client with embedded Chrome subprocesses

Postby abakre » Fri Jan 27, 2017 4:42 am

Selenium Chromedriver for CEF Client with embedded Chrome subprocesses

I have a CEF based application which invokes Chrome subprocesses as part of one of the functions.
I was trying to use Selenium Webdriver to do some automated tests on this application.

Tried the normal way with the instructions from: https://bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md
However my application crashes as it is not Chrome when it is started.

Sample code: Consider mfchost.exe as my application

Code: Select all
    // Path to the ChromeDriver executable.
    System.setProperty("webdriver.chrome.driver", "c:/temp/chromedriver.exe");

    // Path to the CEF executable.
    ChromeOptions options = new ChromeOptions();
    options.setBinary("c:/temp/mfchost.exe");
    options.setExperimentalOption("debuggerAddress", "localhost:1234");
    //Tried all other ways of providing remote debugging port
    WebDriver driver = new ChromeDriver(options);
    driver.get("http://www.google.com/xhtml");


My issue seems to be similar to what is mentioned in https://liusy182.wordpress.com/2015/03/24/running-selenium-on-cef/

Unfortunately, this doesn't work.
The reason is twofold. First, chromedriver.exe will launch mfchost.exe and treat is as the chrome.
This is definitely wrong because mfchost.exe won’t have the port configured for communication.
Second, chromedriver.exe will start mfchost.exe with flag “–remote-debugging-port=1234”.
This is again wrong because mfchost.exe has no idea what this flag means because it is not a chromium page at all

However, I was wondering if we have any other solution that I need to look at than what is mentioned in the above link as the code has evolved a lot from 2015.

Please suggest.
abakre
Newbie
 
Posts: 1
Joined: Fri Jan 27, 2017 4:05 am

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 26 guests