Page Object Model – Python Selenium with PyTest – Part 1
In this video, I have explained the design and how to create UI Automation Framework with PyTest using POM (Page Object Model) design pattern.
Technologies used:
Python 3.x
Selenium WebDriver Python Language binding
PyTest – test framework
Pytest – html report
Pytest-xsld for parallel execution
PyCharm – IDE
Thank you, you should get more appreciation for this wonderful content..
Thanks for this, I have been doing selenium in java years and just got a python gig. Was good to see you tutorial explaining py as it relates to java and the differences.
Thanks Navven for the series on pytest and POM. Can you cover screenplay using the same login test?
Hello Naveen Sir, A small request, kindly show how to select values from static drop down *through page object model, reusable method* please ?
Hi sir, could you please make a video on how to create a function in python to select dependant drop down values. For example select a drop down value, then based on the selection another drop down appears with values. All the dependant drop down should have same xpath but should only differ in it’s preceding value.
Hi could you prepare a video regarding how to automate when we have to perform drag and drop on slider which does not have any value in its properties. But we want to perform drag and drop using some defined values
Thank you Naveen. It is very insightful. And very helpful for people who don’t understand where to start to build framework.
Hi Naveen,
I’m new to automation and have a doubt.. Having Utility class is good or bad idea.
I know that it helps in reusability.. I have gone through few blogs they say this not to use utility class.
I’ve also seen your videos saying create utility classes.. I’m bit confused. Please help ?
Amazing! Loved the explaination! Thank you
Nice video thank you! I just have an issue when I’m trying to navigate inside the webpage and paging to a different sub page on website the webdriver jumps back to the original URL. Can you give any advice with that? Much appreciation in advance:)
Hi Naveen,
Thanks a lot for the video. I’m looking for this session Pyest using POM
I have a doubt here how to run only failed tests in Pytest??? do we have any package to install to run only specific fail tests wherein Java, we can run by using testng-failed.xml file.
Awaiting for next video 🙂
Hello Sir, I completely followed your code but on side side it’s just running one test not the remaining 2 also when i tried to run tests in parallel. why this?
Hi Naveen, Thanks for the video. I implemented the same thing you showed, but got an error AttributeError: ‘LoginPage’ object has no attribute ‘driver’. Can you please help me figure out the reason for this
Try adding BasePage as the parameter in the class.
Eg. class LoginPage(BasePage):
Also don’t forget to import BasePage
from Pages.BasePage import BasePage
Sir wonderfully explained, is this uploaded to GIT?
Hello, how are you? To make a connection with BDD behave or with pytest-bdd as it would be with the FW that you are building, I tried but could not. What if I could do is how far did you get with the framework
Hi
Is the code of your presentation available to download?
Was searching from a couple days for an exact video on PyTest Framework and came across this video. Its really very helpful. Now this will help me start creating a framework on my own for my project. Thank you very much Naveen 🙂
Hi Sharat
Can you share sample code structure based on POM.
To login , take screenshot and generate report
Using selenium python pytest and any report
Hi Naveen, Nice video. I tried the same flow but getting AttributeError: ‘TestLogin’ object has no attribute ‘driver’ in test_login_page method as below. I checked the code syntax and spelling. Everything is fine.
def test_login_page(self):
> self.loginPage = LoginPage(self.driver)
E AttributeError: ‘TestLogin’ object has no attribute ‘driver’
Tried to resolve it but not getting the right resolution to fix it.
@Harish Ms Did you find the solution for this issue, I am also facing the same
Hi Naveen, great tutorial, I need to work with pytest-bdd. Can you tell me how this framework can also be tweaked for bdd implementation.
hi Naveen,nice content. do we have this code in github. can you pls share the link