#selenium chrome usagehtml
environmentjava
##1.Selenium support browser typepython
default : firefoxgit
chromegithub
IEweb
safarichrome
##2. chromedriver usageapi
###2.1 Download chromedriver here.python2.7
###2.2 Paste the chromedriver.exe file in "C:\Python27\Scripts" Folder.this
##3. Test ###3.1 start selenium grid hub you can follow my pre blog selenium grid2
###3.2 Code
options=webdriver.ChromeOptions() options.add_argument('--disable-logging') driver=webdriver.Remote("http://localhost:4200/wd/hub",desired_capabilities=options.to_capabilities())
###3.3 run your script
if chrome is opening successfully,it works.
##4. Exception you might got this error message:
Caused by: java.lang.IllegalStateException: The path to the driver executable mu st be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
##5. another usage
no need to start selenium grid
Code
capabilities = DesiredCapabilities.CHROME capabilities['loggingPrefs'] = {'browser':'ALL'} driver = webdriver.Chrome(executable_path=chromedriver,desired_capabilities=capabilities)
##6. reference