Selenium Webdriver Tutorials with Python

///Selenium Webdriver Tutorials with Python

Selenium Webdriver Tutorials with Python

FavoriteLoadingAdd to favorites

In this seminar, I have mainly covered how we can start Selenium WebDriver with Python .

This video will mainly cover

1- Introduction to Python
2- Install Python
3- Install PyCharm (IDE for Python)
4- First program in Python
5- First Webdriver script.
6- How to run selenium script in Chrome browser
7- How to run selenium script in IE browser
8- Capture screenshot in Selenium using Python

-~-~~-~~~-~~-~-
Please watch: “How To Create Maven build For Selenium Framework”

-~-~~-~~~-~~-~-

source

By |2020-02-05T01:39:13+00:00February 5th, 2020|Python Video Tutorials|25 Comments

25 Comments

  1. Abhishek Shakure February 5, 2020 at 1:39 am - Reply

    When I try to run a piece of code on pycharm i get this error, can someone help what could be the issu

    C:UsersfoldernameAppDataLocalProgramsPythonPython38NewPycharmScriptspython.exe C:/Users/foldername/PycharmProjects/firtsPython/SeleniumPrograms/FirstSeleniumCode.py

    Traceback (most recent call last):

    File "C:/Users/foldername/PycharmProjects/firtsPython/SeleniumPrograms/FirstSeleniumCode.py", line 7, in <module>

    browser.get("http://www.facebook.com")

    AttributeError: module 'selenium.webdriver.firefox' has no attribute 'get'

    program is (username and password in the real program were given as values)
    from selenium import webdriver

    from selenium.webdriver.support.ui import WebDriverWait

    # Step 1) Open Firefox

    browser = webdriver.Firefox()

    # Step 2) Navigate to Facebook

    browser.get("http://www.facebook.com")

    # Step 3) Search & Enter the Email or Phone field & Enter Password

    username = browser.find_element_by_id("usrname")

    password = browser.find_element_by_id("pass")

    submit = browser.find_element_by_id("loginbutton")

    username.send_keys("YOUR EMAILID")

    password.send_keys("YOUR PASSWORD")

    # Step 4) Click Login

    submit.click()

    wait = WebDriverWait( browser, 5 )

    page_title = browser.title

    assert page_title == "Facebook"

  2. farmakoxeris February 5, 2020 at 1:39 am - Reply

    39:17 The mistake is that you used one dot insted of two. One dot would be right if the directory "Screenshots" was inside "SeleniumScripts". However, both "Screenshots" and "SeleniumScripts" were sub-directories of the same parent-directory. For that reason, you should have written "../Screenshots/Facebook.png".

  3. farmakoxeris February 5, 2020 at 1:39 am - Reply

    16:14 So, the very first line has the author thing. Is that just an ordinary string variable or a system variable?

  4. farmakoxeris February 5, 2020 at 1:39 am - Reply

    30:27 What is the Home directory?

  5. Lil Pup February 5, 2020 at 1:39 am - Reply

    25:50

    How did you copy as xpath I can only copy

  6. VC music videos February 5, 2020 at 1:39 am - Reply

    I have a problem…my chrome opens up but does not go ahead to open facebook website. I did ***driver.get("http://www facebook.com")

  7. studio February 5, 2020 at 1:39 am - Reply

    Thanks it is very nice video for beginner.

  8. Pushpendu Paul February 5, 2020 at 1:39 am - Reply

    Please share Python automation videos!!!!

  9. Nishant Menghare February 5, 2020 at 1:39 am - Reply

    these are my errors plss help me

    C:Pythonpython.exe "C:/Users/Nishant-PC/PycharmProjects/nikkipython/Selenium Script/MyFirstSeleniumScript.py"

    Traceback (most recent call last):

    File "C:/Users/Nishant-PC/PycharmProjects/nikkipython/Selenium Script/MyFirstSeleniumScript.py", line 3, in <module>

    driver = webdriver.chrome("D:seleniumchrome driverchromedriver.exe")

    TypeError: 'module' object is not callable

    Process finished with exit code 1

  10. codeWithSingh February 5, 2020 at 1:39 am - Reply

    thank you bro

  11. saathvika m February 5, 2020 at 1:39 am - Reply

    13:15 though i have specified.. i see error when i click on new projects saying not able to save.
    And am not able to trace y it is so from logs too…
    Help me

  12. kamalnath L P February 5, 2020 at 1:39 am - Reply

    sir, for the screen shot directory you should start with "../screenshots/filename.png"

  13. The One Jesus Loved February 5, 2020 at 1:39 am - Reply

    Help!!!! Im getting an error

    Traceback (most recent call last):

    File "C:/Users/domoj/PycharmProjects/traffic/configurex.py", line 4, in <module>

    driver = webdriver.Chrome('C:Selenium\76chromedriver.exe')

    File "C:UsersdomojAppDataLocalProgramsPythonPython37-32libsite-packagesseleniumwebdriverchromewebdriver.py", line 81, in _init_

    desired_capabilities=desired_capabilities)

    File "C:UsersdomojAppDataLocalProgramsPythonPython37-32libsite-packagesseleniumwebdriverremotewebdriver.py", line 157, in _init_

    self.start_session(capabilities, browser_profile)

    File "C:UsersdomojAppDataLocalProgramsPythonPython37-32libsite-packagesseleniumwebdriverremotewebdriver.py", line 252, in start_session

    response = self.execute(Command.NEW_SESSION, parameters)

    File "C:UsersdomojAppDataLocalProgramsPythonPython37-32libsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute

    self.error_handler.check_response(response)

    File "C:UsersdomojAppDataLocalProgramsPythonPython37-32libsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response

    raise exception_class(message, screen, stacktrace)

    selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 76

  14. Nainika Dwivedi February 5, 2020 at 1:39 am - Reply

    i m getting error when running the facebook thing..can u tell me the path where to save the python file

  15. Pankaj Kulkarni February 5, 2020 at 1:39 am - Reply

    hi mukesh thank you for wonderful session . i am facing problem in passing value to date range picker
    like trivago date range picker ..can you help me

  16. Roopa Chebolu February 5, 2020 at 1:39 am - Reply

    can you pls upload video on selenium web driver interview questions real time

  17. Roopa Chebolu February 5, 2020 at 1:39 am - Reply

    sir i have a doubt pls kindly help me i just wanted to check with you this is complete knowledge of selenium webdriver or do we have to follow any other videos i need complete knowledge of selenium webdriver

  18. suganya p February 5, 2020 at 1:39 am - Reply

    Hi Mukesh,

    Getting below error while running the script to open Google Chrome.Please assist.

    Traceback (most recent call last):

    File "C:/Users/SuganyaPalanivel/PycharmProjects/Wwebinar/SeleniumScripts/MyFirstSeleniumScript.py", line 3, in <module>

    driver=webdriver.Chrome("C:\Python27Users\chromedriver.exe")

    File "C:Python27libsite-packagesseleniumwebdriverchromewebdriver.py", line 73, in _init_

    self.service.start()

    File "C:Python27libsite-packagesseleniumwebdrivercommonservice.py", line 83, in start

    os.path.basename(self.path), self.start_error_message)

    selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

  19. elavarasan v February 5, 2020 at 1:39 am - Reply

    how to download web driver for chrome
    plz help me

  20. Shraddha Goel February 5, 2020 at 1:39 am - Reply

    python installed successfully but wheel is not available. when i tried installing wheel and selenium, getting error as below:
    Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B7FE1A3860>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/wheel/

    Please help me on this.
    i tried – pip install wheel
    and pip install selenium using command prompt

  21. Arpita Sharma February 5, 2020 at 1:39 am - Reply

    Awsum video. Kindly upload other videos too.

  22. dhanashree saraf February 5, 2020 at 1:39 am - Reply

    Hi ,
    After running first selenium script in Pycharm for opening Google Chrome, I got error message :Traceback (most recent call last):
    File "C:/Users/HP/PycharmProjects/Webinar/SeleniumScripts/MyFirstSeleniumScript.py", line 1, in <module>
    from selenium import webdriver
    ModuleNotFoundError: No module named 'selenium'

  23. Sandeep Singh February 5, 2020 at 1:39 am - Reply

    Hi Mukesh, Awesome video as usual 😄 but is there only this 1 video as I am unable to find any other videos on selenium using Python. Thank you for clarifying this doubt

  24. Raj Kumar February 5, 2020 at 1:39 am - Reply

    I got this message "'pip' is not recognized as an internal or external command,'
    "

  25. Nirmala Nirmi February 5, 2020 at 1:39 am - Reply

    Hi Mukesh, in command prompt, python installed but for pip showing fatal error. How to solve this?

Leave A Comment

*