Chromedriver2 and CEF3: how to setup?

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Chromedriver2 and CEF3: how to setup?

Postby Mika » Wed Feb 12, 2014 4:27 pm

Hi guys,

I'd like to give Chromedriver 2 a try with CEF.

It seems to be supported with CEF3:
http://chromiumembedded.googlecode.com/ ... Usage.wiki

Can someone please show me the steps?

I've successfully managed to drive Chrome with Chromedriver2.
But don't know how to start for the "cefclient" example with Chromedriver2.

Thanks
Mika
Newbie
 
Posts: 8
Joined: Fri Feb 07, 2014 6:34 pm

Re: Chromedriver2 and CEF3: how to setup?

Postby magreenblatt » Wed Feb 12, 2014 5:23 pm

Something like this should work (in Java) but I have not personally tried it:

Code: Select all
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.*;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.io.*;

public class testSetUp {
   public static void main(String[] args) {
      ChromeDriverService service = new ChromeDriverService.Builder()
         .usingDriverExecutable(new File("C:\\Testautomationstuff\\chromedriver.exe"))
         .usingPort(1131)
         .build();
      
      try {
         service.start();   
         System.out.println("Chromedriver Service started on "+service.getUrl());
      } catch (IOException e){
      }
      
      ChromeOptions options = new ChromeOptions();
      options.setBinary(new File("C:\\testApps\\myChromiumEmbeddedApplication.exe"));
      options.addArguments("--remote-debugging-port=1131");
      
      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setCapability(ChromeOptions.CAPABILITY,  options);
      WebDriver driver = new RemoteWebDriver(service.getUrl(), capabilities);
      
      System.out.println(driver.getWindowHandles());
   }
}

You might also need the port number functionality described in https://code.google.com/p/chromedriver/ ... ail?id=205.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Chromedriver2 and CEF3: how to setup?

Postby Mika » Wed Feb 12, 2014 6:13 pm

Thanks again. I'm not a java fan.
A command line way to do it would be awesome.
Help guys?
Mika
Newbie
 
Posts: 8
Joined: Fri Feb 07, 2014 6:34 pm

Re: Chromedriver2 and CEF3: how to setup?

Postby magreenblatt » Wed Feb 12, 2014 6:16 pm

How are you using chromedriver currently with chrome?
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Chromedriver2 and CEF3: how to setup?

Postby Mika » Thu Feb 13, 2014 12:19 am

Very easy to setup (I'm under Linux):

$ wget http://chromedriver.storage.googleapis. ... inux32.zip
$ unzip chromedriver_linux32.zip
$ chmod +x chromedriver
$ sudo cp chromedriver /usr/bin/

Then, run it:
$ chromedriver
Starting ChromeDriver (v2.9.248316) on port 9515

I'm assuming here you've Google Chrome already installed.
My version is: 32.0.1700.107

Then, I can use the Python (or whatever API) to automate it:
http://damien.co/resources/how-to-insta ... ython-7406

Pretty easy as you can see.

Hope this help figure out how to fix my problem with CEF3.

Thx
Mika
Newbie
 
Posts: 8
Joined: Fri Feb 07, 2014 6:34 pm

Re: Chromedriver2 and CEF3: how to setup?

Postby magreenblatt » Thu Feb 13, 2014 11:45 am

Well, it should work the same with CEF3. You will need to figure out how to point it to your CEF-based executable, and use the --remote-debugging-port=XXX argument to enable remote-debugging in the CEF application.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Chromedriver2 and CEF3: how to setup?

Postby Mika » Thu Feb 13, 2014 7:06 pm

After a day of googling, I didn't find anyway to link them together.
Really sad.
Mika
Newbie
 
Posts: 8
Joined: Fri Feb 07, 2014 6:34 pm

Re: Chromedriver2 and CEF3: how to setup?

Postby JoeF » Sat May 10, 2014 5:20 am

Is it possible to use username and password?

such as:
--remote-debugging-port=1131 -user myusrname -password mypasswd
JoeF
Techie
 
Posts: 21
Joined: Thu May 08, 2014 5:12 am

Re: Chromedriver2 and CEF3: how to setup?

Postby magreenblatt » Wed Feb 11, 2015 6:51 pm

I've added a short tutorial explaining how to automate CEF3 with ChromeDriver and Java: https://code.google.com/p/chromiumembed ... romeDriver
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Chromedriver2 and CEF3: how to setup?

Postby eplaksienko » Fri Sep 04, 2015 8:21 pm

Hi I have question, how to attach remote chrome driver to already opened CEF application? Thanks
eplaksienko
Newbie
 
Posts: 1
Joined: Fri Sep 04, 2015 8:18 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 36 guests