Selenium Python Tutorial #66 - Take Screenshot on Failure in Pytest
HTML-код
- Опубликовано: 10 сен 2024
- Get all my courses for USD 5.99/Month - bit.ly/all-cou...
In this Selenium Python Tutorial, we will learn how to take screenshot on failure in pytest and embed it in Selenium Python HTML report.
FULL Playlist: bit.ly/Selenium...
🔸FREE Training's at training.rcvac... 🔔SUBSCRIBE to CHANNEL: bit.ly/2YGU6JM
Help me in spreading the knowledge, please hit LIKE, SHARE, and SUBSCRIBE for the latest tutorials. More tutorial playlists below:
✅ ALL PLAYLISTS (Software Testing Mentor)🔸 / softwaretestingmentor
✅ ALL PLAYLISTS (RCV Academy)🔸 / @rcvacademy
✅ JIRA BEGINNER TUTORIAL🔸 bit.ly/jira-beg...
✅ JIRA WORKFLOW TUTORIAL🔸 bit.ly/2EzKOEB
✅ JIRA ADMINISTRATION TUTORIAL🔸 bit.ly/36MPPFR
✅ JIRA TUTORIAL INTERMEDIATE🔸 bit.ly/Atlassia...
✅ JIRA TUTORIALS🔸 bit.ly/jira-tut...
✅ ZEPHYR TUTORIAL🔸 bit.ly/zephyr-f...
✅ SOAPUI TUTORIAL🔸 bit.ly/Sopui-tu...
✅ JSONPath TUTORIAL🔸 bit.ly/2sIZIFG
✅ POSTMAN TUTORIAL🔸 bit.ly/2PBbhI7
✅ ISTQB AGILE TESTER CERTIFICATION TUTORIAL🔸 bit.ly/istqb-ag...
✅ ISTQB FOUNDATION LEVEL CERTIFICATION TUTORIAL🔸 bit.ly/istqb-fo...
✅ CUCUMBER SELENIUM TUTORIAL🔸 bit.ly/cucumber...
✅ TESTRAIL TUTORIAL🔸 bit.ly/testrail...
✅ AGILE TUTORIALS🔸 bit.ly/agile-tu...
✅ PYTHON TUTORIALS🔸 bit.ly/python-p...
✅ PYTHON BEHAVE TUTORIALS🔸 bit.ly/python-b...
✅ PRACTITEST TUTORIAL🔸 bit.ly/practite...
✅ JAVA TUTORIAL🔸 bit.ly/2F1iL1B
✅ ZEPHYR TUTORIAL🔸 bit.ly/zephyr-f...
🔶 ENROL IN MANY FREE TRAININGS ON RCV ACADEMY PORTAL 🔶
training.rcvaca...
🔶 FOLLOW US ON TWITTER 🔶
/ rcvacademy
/ swtmentor
/ mrmverma
🔶 LIKE US ON FACEBOOK 🔶
/ softwaretestingmentor
/ rcvacademy47
🔶 OUR TUTORIAL WEBSITES 🔶
www.softwarete...
www.rcvacademy...
🔶 GET MY TRAININGS ON UDEMY 🔶
www.udemy.com/...
#SeleniumPythonTutorial #PythonSelenium #SeleniumPython #PythonSeleniumTutorial #SeleniumWebdriver #TestAutomation #SoftwareTesting #RcvAcademy #SoftwareTestingMentor
Join this channel to get access to perks:
/ @softwaretestingmentor
Hi, Thank you for your explanation. It is really wonderful. One request here can anyone help me how to keep only the link of screenshot in the reports instead of actual image. So that the user can only clicks on the link of screenshots and can see in another tab.
Sir, I think you have just solved my headache. in like 5 minutes :D I need to check it tomorrow but damn if this is JUST so simple
Hi sir, how did you link the driver in setup fixture and pytest_runtest_makereport hook? It's not being recognised in my script and it's throwing me an error that the variable isn't defined
I figured it out. Add driver = item.cls.driver before driver.save_screenshot(destinationFile)
I haven implemented this but when this report is sent over the mail only the screen shot is seen on same system only
Is there any way that we can see the screen shot on other systems also
Hi, Thanks for your video. I have the screenshots working, but is there a way to record a video of the entire test to see what happened before the test failed?
hi, can someone help me with reports. My report are not showing logs details in it
remove -s from command when you are running pytest
Awesome, thank you very much !
Hi sir, can you please make a videos on selenium with python interview series for experienced people...
Cracking the interviews
Hello, Manish. Thank you for your video. I have a question: I have YAML files to run test cases with. How to run and debug test cases without creating command lines? I feel like it takes more time to write and execute tests in PyCharm than it should. For example, to debug the test I have to attach the process and make sure that the command line is correct. Otherwise, it would fail and be very hard to figure out why.
Can I get a screenshot on html report even if it is PASSED?
Hi everyone. I have got this error :
INTERNALERROR> driver.save_screenshot(destinationFile)
NameError: name 'driver' is not defined
I think driver itself will be handled by pytest (since there is a fixture)
How to make things work ya? Can someone help me
make driver global -
def setup(request):
global driver
@@parthasarathiparthasarathi8904 many thanks!
Hi , Thank you. Can you please share the code in desc ?
How to add screenshots for positive test cases too ?
Why this code is not working now
How can i add my own data on Table Row
I am spending a long time but I unable to get a screen shot but generating link Please make another shot vedio for selenium python in linux based
This thing get's complex .. pretty quickly 😣😣😣
This doesn't work !!! below error comes:
driver.get_screenshot_as_file(destinationFile)
INTERNALERROR> AttributeError: 'function' object has no attribute 'get_screenshot_as_file'
The function is "save_screenshot", not "get_screenshot_as_file".
@@michalamarkova1644 Hi. I have got this error :
INTERNALERROR> driver.save_screenshot(destinationFile)
NameError: name 'driver' is not defined
I think driver itself will be handled by pytest (since there is a fixture)
How to make things work ya?
@@Yuri-is7rb add :
feature_request = item.funcargs["request"]
driver = feature_request.getfixturevalue('setup')
after if (report.skipped and xfail) or (report.failed and not xfail):
@@Yuri-is7rb make driver global variable in setup fixture