FREE courses - https://automationstepbystep.com/
Selenium Python: Sample Project
1. Create a test for Google Search
2. Add implicit wait of 10 sec
3. Maximize window
4. Create Unit Tests
5. Add HTML reporting library
6. Run from command line
References:
How to install Python on Windows with basic setup - • Selenium Python Beginner Tutorial - Learn ...
How to install Python on Mac - • How to install and uninstall PYTHON on MAC
Pycharm installation and setup can be taken from - • Selenium Python Beginner Tutorial - Learn ...
Code:
from selenium import webdriver
import unittest
import HtmlTestRunner
class GoogleSearch(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.driver = webdriver.Chrome(executable_path='../drivers/chromedriver.exe')
cls.driver.implicitly_wait(10)
cls.driver.maximize_window()
def test_search_automationstepbystep(self):
self.driver.get("https://google.com")
self.driver.find_element_by_name("q").send_keys("Automation Step by Step")
self.driver.find_element_by_name("btnK").click()
def test_search_raghav(self):
self.driver.get("https://google.com")
self.driver.find_element_by_name("q").send_keys("Raghav Pal")
self.driver.find_element_by_name("btnK1").click()
@classmethod
def tearDownClass(cls):
cls.driver.close()
cls.driver.quit()
print("Test Completed")
if _name_ == '__main__':
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output='C:/Users/Administrator/PycharmProjects/Selenium/reports'))
#SeleniumPythonSampleProject
ONLINE COURSES TO LEARN
----------- UI TESTING -----------
Selenium Beginners - https://bit.ly/2MGRS8K
Selenium Java Framework from Scratch - https://bit.ly/2N9xvR6
Selenium Python - https://bit.ly/2oyMp5x
Selenium Tips - https://bit.ly/2owxc50
Selenium Builder - https://bit.ly/2MKNtlq
Katalon Studio - https://bit.ly/2wARFdi
Robot Framework - https://bit.ly/2Px6Ue9
----------- API TESTING -----------
Web Services (API) - https://bit.ly/2MGafL7
SoapUI - https://bit.ly/2MGahmd
Postman - https://bit.ly/2wz8LrW
General - https://bit.ly/2PYdwmV
----------- MOBILE TESTING -----------
Mobile Playlist - https://bit.ly/2PxpeUv
----------- CI | CD | DEVOPS -----------
Jenkins Beginner - https://bit.ly/2MIn8EC
Jenkins Tips & Trick - https://bit.ly/2LRt6xC
Docker - https://bit.ly/2MInnzx
----------- VERSION CONTROL SYSTEM -----------
Git & GitHub - https://bit.ly/2Q1pagY
----------- PERFORMANCE TESTING -----------
JMeter Beginner - https://bit.ly/2oBbtIU
JMeter Intermediate - https://bit.ly/2oziNVB
JMeter Advanced - https://bit.ly/2Q22Y6a
JMeter Tips & Tricks - https://bit.ly/2NOfWD2
Performance Testing - https://bit.ly/2wEXbLS
----------- JAVA -----------
Java Beginners - https://bit.ly/2PVUcXs
Java Tips & Tricks - https://bit.ly/2CdcDnJ
----------- MAVEN -----------
Maven - https://bit.ly/2NJdDRS
----------- OTHERS -----------
Redis- https://bit.ly/2N9jyCG
Misc - https://bit.ly/2Q2q5xQ
Tools & Tips - https://bit.ly/2oBfwoR
QnA Friday- https://bit.ly/2NgwGpw
Sunday Special - https://bit.ly/2wB23BO
Ask Raghav- https://bit.ly/2CoJGWf
Interviews - https://bit.ly/2NIPPxk
All Playlists - https://bit.ly/2LSiezA
----------- Follow -----------
Facebook - / automationstepbystep
Twitter - / automationsbs
Youtube - / automationstepbystep
_______ ONLINE COURSES TO LEARN _______
https://automationstepbystep.com/909-...
Auf dieser Seite können Sie das Online-Video Selenium Python Small Sample Project 1 | Unit Test, HTML Reports mit der Dauer online in guter Qualität ansehen, das der Benutzer Automation Step by Step 23 September 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 92,316 Mal angesehen und es wurde von 980 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!