Python Selenium Testing Framework

 Python Selenium Testing Framework


Why python use for testing purpose ?

    Python is easy to understand & easy for writing codes. Now a days world is moving towards Artificial Intelligence & Machine Learning & python plays a crucial role for that. To solve complex problem in AI & ML, Python use for coding purpose than Java.c#,etc. Because when we write a specific code in java or c# in 3 to 4 lines python do it in single line. This is  the smartness of python language.

    Due to implementation of AI & ML testing world is slowly moving towards python testing framework (Pytest) similar to TestNg, Junit. Because of pytest framework developer as well as tester realax due to python easy code indentation compare to other programming language such as Java ,c# ,c,c++.

Why Selenium?

    Selenium is open source automation tool & it provides a strong environment to Java,C# , & Python as well. It can be easily integrate with python & other programming languages. 

What is requirement to become selenium python automation tester ?

    1) You need hands on command on Python language (Not necessary 100%).

    2) You have a good knowledge about Seleniunm.

    3) You have know about Python testing framework.

    How to install selenium in your machine ?

    Int his case while downloading python provide pip. This pip have capability to install selenium as well as other packages related to python framework. 

        " pip install selenium"   Use this command in cmd terminal in your machine.

    You have to integrate python selenium in your machine by selecting selenium IDE in your machine.

    How to invoke browser in pytest framework ?

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

    How to invoke URL?

    driver.get("URL")

    How to edit form ( username ,password , Email) ?

     Driver.find element by (use any HTML tag – id , class , link text , name , Xpath , Css  Selector).Send _keys(“ “)

    Which are the  locators to find web elements on browser ?

1)      ID

2)      NAME

3)      CLASS NAME

4)      XPATH

5)      CSS SELECTOR

6)      LINK TEXT

Above locators are used to fond web elements which are help in python script for testing purpose.

How to click checkbox ?

driver. find element by ("taganame" -- use HTML tags)( use any locators).click()

    Here driver is object made for better iteration.

    


           

Comments