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

Комментарии • 26

  • @ranjeetkumar32
    @ranjeetkumar32 3 месяца назад

    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.

  • @karolmichalik9378
    @karolmichalik9378 2 года назад

    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

  • @vishwasrchonu7134
    @vishwasrchonu7134 4 месяца назад

    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

    • @vishwasrchonu7134
      @vishwasrchonu7134 4 месяца назад

      I figured it out. Add driver = item.cls.driver before driver.save_screenshot(destinationFile)

  • @multiskilltechnician6504
    @multiskilltechnician6504 Год назад

    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

  • @ChristopherJohnson-st6fn
    @ChristopherJohnson-st6fn 8 месяцев назад

    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?

  • @moizahmed986
    @moizahmed986 Год назад +1

    hi, can someone help me with reports. My report are not showing logs details in it

  • @nobitalua1560
    @nobitalua1560 2 года назад +1

    Awesome, thank you very much !

  • @sateeshkumar795
    @sateeshkumar795 9 месяцев назад

    Hi sir, can you please make a videos on selenium with python interview series for experienced people...
    Cracking the interviews

  • @tetianakravchuk464
    @tetianakravchuk464 2 года назад

    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.

  • @hatoji8154
    @hatoji8154 Год назад

    Can I get a screenshot on html report even if it is PASSED?

  • @Yuri-is7rb
    @Yuri-is7rb Год назад

    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

  • @user-vd4bp6it6d
    @user-vd4bp6it6d 7 месяцев назад

    Hi , Thank you. Can you please share the code in desc ?

  • @kamalnayan7696
    @kamalnayan7696 Год назад

    How to add screenshots for positive test cases too ?

  • @prayagjain4665
    @prayagjain4665 Год назад

    Why this code is not working now

  • @YogeshBecse
    @YogeshBecse Год назад

    How can i add my own data on Table Row

  • @manikandanv1811
    @manikandanv1811 2 года назад

    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

  • @DataWiseDiscoveries
    @DataWiseDiscoveries 2 года назад +1

    This thing get's complex .. pretty quickly 😣😣😣

  • @aditiandsalin
    @aditiandsalin 2 года назад

    This doesn't work !!! below error comes:
    driver.get_screenshot_as_file(destinationFile)
    INTERNALERROR> AttributeError: 'function' object has no attribute 'get_screenshot_as_file'

    • @michalamarkova1644
      @michalamarkova1644 Год назад

      The function is "save_screenshot", not "get_screenshot_as_file".

    • @Yuri-is7rb
      @Yuri-is7rb Год назад

      @@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?

    • @mariateresasilvasandoval4753
      @mariateresasilvasandoval4753 Год назад

      @@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):

    • @GLR174
      @GLR174 Год назад +2

      @@Yuri-is7rb make driver global variable in setup fixture