How can I register webdrivers for python-selenium?

0 votes
May 15, 2019 in Selenium by Shelly
116 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, 2019 by Pratibha
• 3,690 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,520 points
17,897 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
646 views
+1 vote
2 answers

How can I delete an element in Selenium using Python?

You can directly delete the node using ...READ MORE

answered Sep 14, 2019 in Selenium by tonystark
• 500 points
7,612 views
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, 2019 in Selenium by Anvi
• 14,110 points
200 views
0 votes
2 answers

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,520 points
4,074 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
5,033 views
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,890 points
2,963 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
3,393 views
0 votes
1 answer

How can I scroll a web page in Mozilla Firefox using Selenium?

Hi Rohan, steps to scroll a webpage in ...READ MORE

answered May 13, 2019 in Selenium by Pratibha
• 3,690 points
1,015 views
0 votes
1 answer

Can anyone explain how an AJAX call can be handled in Selenium webdriver?

Hello Megha, to demonstrate how AJAX calls are ...READ MORE

answered May 8, 2019 in Selenium by Pratibha
• 3,690 points
416 views