Part 6 - How to Parametrize test in PyTest (Parameterization)
HTML-код
- Опубликовано: 10 сен 2024
- In this video, I have explained how to paramterize test cases with different data in pytest.
Parameterizing of a test is done to run the test against multiple sets of inputs. We can do this by using the following marker −
you need to use @pytest.mark.parametrize decorator.
~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/...
Paid courses (Recorded) videos:
naveenautomati...
For Java & Selenium - naveenautomatio...
For API (Manual + Automation) - naveenautomatio...
Thank you for the great video!!!
Very clear concepts and full of knowledge. I was doing this to import data from DEV and QA servers and compare of count of reports etc… and passing the table list as parametrised fixtures, facing challenges to pass the parameter to DB and get results. Any thoughts please?
Very clear Naveen
With latest update, fixture's scope has be set to "function" instead of "class" for parameterization to work. If scope is set for "class", then your driver wont quit and wont trigger the next test.
Hi Naveen,
Why don't I get any auto suggestion from Pycharm, when i do self.driver. something in test method?
Is there any fix for the above issue?
Nice series ❤
Please also provide some session on advance Pytest & Fixture
Hi naveen,
How to validate the test cases for this scenario. And y did you use that Class?
Hi Naveen thank you for the great work your doing, can you please upload a video to integrate selenium python with Azure DevOps Testcases
I am not able to get past the 5 second hubspot window screen... My code is fine and browsers are launching...But element not found error I'm getting because its unable to go past the 5 second login window..How to resolve?? Please help....I tried Explicit waits but still no resolution...its pinging refresh again and again...
Even happens with me as as well. I think the website has implemented some mechanism to stop the automation.
On using self.driver. why methods like find_elements(), title(), find_element_by_, switch_to(), window_handles() and rest are not auto-populating? Its frustrating to write the whole thing when they don't auto populate. Same works without using fixtures and but with conftest and with request.cls.driver = web_driver, they just don't show up. Naveen, do you know why its happening? I am sure you might have also noticed it as you were typing all the methods or either copying from other .py files?
I think that is a bug with pycharm.I too noticed it.If its not a bug and if i can figure out how to do that I would let u know.
@@shankubisai1370 🙏🏻 let me know if you find a solution to it. After all we’re IDE for a purpose!
Otherwise why use Notepad and type all the code lines!!!
Hey Naveen guruji , why u r creating base class . without creating base class isn't it possible
thank you for the video but i am unable to parameterize in the test it self, i am getting error inderect fixture does not exist kind
i referred pytest documentation, we have to give as "num,result" and not "num","result"
Looks like you have changed it at the later part of the video for class scope fixtures
Nice content I feel this can be explained within less than 12 minutes.
Hi Naveen, please help me how to do Parameterization from reading excel data.
Following
Fixtures Parameterization Vs Test Parameterization ?!?
How to join python with Automation full course