Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
287 views
in Selenium by
recategorized by
I have a requirement where I need to setup selenium webdriver and write script for the same using python. Can anyone guide me to tutorial for the same?

1 Answer

0 like 0 dislike
by

Here are your steps:

  • Install python on your Windows machine. Make sure that you have your PATH environment variable updated and pointing to your python installation.
  • Install Firefox browser at the default location.
  • Open the command prompt and execute below command.
    pip.exe install -U selenium

    Above command prompt will install selenium for you.

  • You can now open Python shell and you can execute below commands.

    from selenium import webdriver
    browser=webdriver.Firefox()
    browser.get('http://www.google.com')

    Also, you can create test.py file using your favorite text editor and save it with the code bove. Once saved you can open command prompt, navigate to directory where your test.py file is and execute bellow command.

    py test.py

    This will open Firefox browser and navigate to Firefox browser.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...