kryskool / cefpython

Automatically exported from code.google.com/p/cefpython
0 stars 1 forks source link

Example of automation using WebDriver/ChromeDriver2 #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
See the WebDriver for Google Chrome:
https://code.google.com/p/chromedriver/wiki/ChromeDriver2

Original issue reported on code.google.com by czarek.t...@gmail.com on 11 Jun 2013 at 7:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
ChromeDriver2 has been verified to work with CEF3.
https://code.google.com/p/chromiumembedded/issues/detail?id=549#c18

Original comment by czarek.t...@gmail.com on 15 Aug 2013 at 7:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
In my cefpython application I specify a remote debug port:
 switches = {"remote-debugging-port": "22222"}
 cefpython.Initialize(settings, switches)

Run chromedriver:
 chromedriver --port=33333

I'm using selenium python bindings:
 from selenium import webdriver
 chromeOptions = {'debuggerAddress':'192.168.1.42:22223'}
 capabilities = {'chromeOptions':chromeOptions}
 browser = webdriver.Remote('http://127.0.0.1:33333' capabilities)
 browser.get("http://www.google.com"
 ....

I wanted chromedriver and selenium on a remote machine so used an ssh tunnel on 
the client:
 ssh -L 0.0.0.0:22223:localhost:22222 localhost

A nice bonus is that in chrome I can access "192.168.1.42:22223" and can use 
the chrome dev tools on the open tabs in my remote browser.

P.S. If you don't want to specify the port you need to add the 
"--remote-debugging-port" chromedriver supplies your app to the switches 
dictionary. Also in the selenium script:
 options = webdriver.ChromeOptions()
 options.binary_location = "/path/to/app"
 browser = webdriver.Chrome(chrome_options=options)

Original comment by finn.hug...@gmail.com on 13 Jan 2014 at 1:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
@comment #5 finn.hughes1
31.0 release added support for Developer Tools. Also the 
--remote-debugging-port switch might not work as expected anymore, because a 
random port is generated by default when 
ApplicationSettings."remote_debugging_port" is not set.

Original comment by czarek.t...@gmail.com on 11 Aug 2014 at 7:16

GoogleCodeExporter commented 9 years ago
There is a tutorial in upstream CEF on how to use Chrome Driver with CEF: 
https://code.google.com/p/chromiumembedded/wiki/UsingChromeDriver

Original comment by czarek.t...@gmail.com on 12 Feb 2015 at 11:41