How can I register webdrivers for python-selenium?

0 votes
May 15 in Selenium by Shelly
44 views

1 answer to this question.

0 votes

Hello Shelly, to register webdrivers like Chrome driver, Gecko Driver etc with Python-Selenium, you can use following line of codes:

1. Chrome Driver: These lines of code can be used in Pydev (Eclipse) to connect with Chrome browser :

driver = webdriver.Chrome("C:\\\\Users\\\\Pratibha\\\\Downloads\\\\chromedriver_win32\\\\chromedriver.exe")   //Pass your chrome driver .exe file path here
driver.maximize_window()   // to open browser in fullscreen
driver.implicitly_wait(2)   // wait for 2 second to load the page completely
driver.get("https://www.google.com")   // use get() function to open specific url

2. Gecko Driver (Firefox): Following lines of code will connect your test scripts with Firefox browser:

drv = webdriver.Firefox(executable_path=r"C:\Users\Pratibha\Downloads\ExtractedFiles\geckodriver-v0.24.0-win64\geckodriver.exe")   //Pass Gecko driver .exe file path here
drv.implicitly_wait(2)   // wait for 2 second to load the page completely
drv.maximize_window()   // to open browser in fullscreen
drv.get(r"https://www.google.com")   // open your desired url with get() method

3. IE Driver: Follow these lines of code to connect with Internet Explorer browser:

drv = webdriver.Ie(r"C:\Users\Pratibha\Downloads\ExtractedFiles\IEDriverServer_x64_3.14.0\IEDriverServer.exe")   // Set your IE driver .exe file path here
drv.implicitly_wait(2)   //wait for 2 second to load the page completely
drv.maximize_window()   // open browser in fullscreen
drv.get(r"https://www.google.com")   // open desired url with get() method
answered May 15 by Pratibha
• 3,680 points

Related Questions In Selenium

+2 votes
2 answers

How can I press ENTER key with the execute_script in selenium python?

The below code containing Keys.ENTER might just ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,110 points
8,043 views
+4 votes
1 answer

How can I configure Eclipse for using Selenium?

Follow the following steps to configure your ...READ MORE

answered Dec 12, 2018 in Selenium by Nabarupa
264 views
+1 vote
2 answers
0 votes
1 answer

How can I write test scripts in Selenium with python?

Hey Khushi, writing test scripts in Selenium ...READ MORE

answered May 9 in Selenium by Anvi
• 13,960 points
77 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
983 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,140 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
883 views
0 votes
1 answer
0 votes
1 answer