Selenium with Python

 Installing Python,Selenium & Pycharm IDE



  • <Command Used>    
    • where python                                 
  • Command to :
    • list all the libraries already available with python
    • Install selenium





How to Run Tests on Chrome, Firefox & IE Browsers


  • Links
    • https://www.selenium.dev/downloads/
    • https://github.com/mozilla/geckodriver/releases
    • https://sites.google.com/a/chromium.org/chromedriver/
    • https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration
    • https://selenium-release.storage.googleapis.com/index.html?path=3.9/
  • Code example: ...\SeleniumProject\MultiBrowser.py

WebDriver Commands

  • Code example: ...\SeleniumProject\basiccommands.py

WebDriver Navigational Commands

  • Code example: ...\SeleniumProject\navigationcommands.py

WebDriver Conditional Commands


  • Code example: ...\SeleniumProject\conditionalcommands.py
WebDriver Implicit wait
  • It is time based


  • Code example: ...\SeleniumProject\Implicitwait.py

WebDriver Explicit wait
  • It is Condition based
  • Expected Conditions
    https://selenium-python.readthedocs.io/waits.html
  • Code example: ...\SeleniumProject\Explicitwait.py

Working with Input box/Test Box
  • Code example: ...\SeleniumProject\InputBoxes.py
Working with Radio buttons and Check boxes
  • Code example: ...\SeleniumProject\RadioButtonAndCheckboxes.py
Working with Drop-down list
  • Code example: ...\SeleniumProject\Dropdown.py
Working with Links | Operations on Web Links | Handling Links
  • Code example: ...\SeleniumProject\Links.py
How to handle Alerts/Popups || Switching to Alerts/Popups

  • Code example: ...\SeleniumProject\Alerts.py
How to handle Frames/iFrames | Switch between the frames


  • Can also pass above using index
  • Code example: ...\SeleniumProject\Frames.py

How to handle Browser Windows | Switch between the Windows


  • Options available for closing windows/ browsers:
    • driver.quit()
    • driver.close()
    • using handles/ titles
  • Code example: ...\SeleniumProject\Windows.py
Working with HTML/Web Table
  • Code example: ...\SeleniumProject\Table.py
How to Scroll Web Pages in Selenium


  • Code example: ...\SeleniumProject\Scrolling.py
Handle Mouse Actions |
           1. Mouse Hover Action
    • Code example: ...\SeleniumProject\MouseHover.py
           2. Double click Action
    • Code example: ...\SeleniumProject\DoubleClick.py
           3. Right Click Action
    • Code example: ...\SeleniumProject\RightClickAction.py
     4. Drag and Drop
    • Code example: ...\SeleniumProject\DragAndDrop.py

How to upload Files

How to Download Files using Chrome Browser

How to Download Files using Firefox Browser

How to read data from MS-Excel using OpenPyXL | Data Driven Testing



How to write data into Excel using OpenPyXL | Data Driven Testing

Data Driven Testing using Microsoft Excel + OpenPyXL Module
  • Code example: ...\SeleniumProject\DataDrivenTestCase.py
Working with Cookies

  • Code example: ...\SeleniumProject\CookiesDemo.py
Capture Screenshots
  • Code example: ...\SeleniumProject\Capturescreen.py
Logging | Generate log file


  • Code example: ...\SeleniumProject\LoggingDemo1.py
  • Code example: ...\SeleniumProject\LoggingDemo2.py
Python UnitTest Framework

  • Code example: ...\SeleniumProject\TestCase1.py
  • Code example: ...\SeleniumProject\TestCase2.py
Python UnitTest Framework Methods
  • Code example: ...\SeleniumProject\TestCase3.py
Python UnitTest | Skipping Tests

  • Code example: ...\SeleniumProject\TestCase3.py

Python UnitTest|Assertions|assertEqual & assertNotEqual




  • Code example: ...\SeleniumProject\AssertionTest1.py

Python UnitTest|Assertions|assertTrue & assertFalse

  • Code example: ...\SeleniumProject\AssertionTest2.py
Python UnitTest|Assertions|assertIsNone & assertIsNotNone


  • Code example: ...\SeleniumProject\AssertionTest3.py

Python UnitTest|Assertions|assertIn & assertNotIn


  • Code example: ...\SeleniumProject\AssertionTest4.py

Python UnitTest|Assertions|Relational comparison


  • Code example: ...\SeleniumProject\AssertionTest5.py

Python UnitTest |Creating and Running Test Suites | Batch Testing



  • Code example: ...\SeleniumwithPython\Package1\TC_LoginTest.py
  • Code example: ...\SeleniumwithPython\Package1\TC_SignupTest.py
  • Code example: ...\SeleniumwithPython\Package2\TC_PaymentTest.py
  • Code example: ...\SeleniumwithPython\Package2\TC_PaymentReturns.py
  • Code example: ...\SeleniumwithPython\TestSuites\All_TestSuites.py


PyTest | Installation and Getting Started







PyTest | Working with PyTest Fixtures



  • Code example:
    • ...\\SeleniumwithPython\test_pytestdemo1.py
    • ...\SeleniumwithPython\test_pytestdemo2.py
PyTest | Run Multiple Tests in PyTest






Unittest+ HTML Reports + Page Object Model


  • Function within a class is called method
  • Code example:
    • ...\\SeleniumwithPython\Test_orange_htm_logintest.py
  • Use command on the terminal or command prompt to generate reports



<cont from 32 mins. Copy updated screenshot>

Oracle Database Connectivity using cx_Oracle |Data Driven Testing


PyTest HTML Report Generation | pytest-html module


How To Generate Allure Reports in Selenium with Python & PyTest

<Upload the code to GIT>

Comments

Popular posts from this blog

Coding projects