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...

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

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

    Thank you for the great video!!!

  • @GauravSingh-tp7zq
    @GauravSingh-tp7zq 2 месяца назад

    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?

  • @rameshbabu2104
    @rameshbabu2104 3 года назад

    Very clear Naveen

  • @HariKrishnan-cs6cr
    @HariKrishnan-cs6cr Год назад +1

    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.

  • @automationneemo
    @automationneemo 3 года назад

    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?

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

    Nice series ❤

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

    Please also provide some session on advance Pytest & Fixture

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

    Hi naveen,
    How to validate the test cases for this scenario. And y did you use that Class?

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

    Hi Naveen thank you for the great work your doing, can you please upload a video to integrate selenium python with Azure DevOps Testcases

  • @ishan23786
    @ishan23786 3 года назад

    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...

    • @shankubisai1370
      @shankubisai1370 3 года назад

      Even happens with me as as well. I think the website has implemented some mechanism to stop the automation.

  • @gtam2294
    @gtam2294 3 года назад

    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?

    • @shankubisai1370
      @shankubisai1370 3 года назад

      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.

    • @iMadeThisThat
      @iMadeThisThat 3 года назад

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

  • @sambeetburma6108
    @sambeetburma6108 4 года назад

    Hey Naveen guruji , why u r creating base class . without creating base class isn't it possible

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

    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

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

      i referred pytest documentation, we have to give as "num,result" and not "num","result"

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

      Looks like you have changed it at the later part of the video for class scope fixtures

  • @trinetras1949
    @trinetras1949 3 года назад

    Nice content I feel this can be explained within less than 12 minutes.

  • @kalyanchakri5099
    @kalyanchakri5099 4 года назад

    Hi Naveen, please help me how to do Parameterization from reading excel data.

  • @m4monzter
    @m4monzter 3 года назад +1

    Fixtures Parameterization Vs Test Parameterization ?!?

  • @TechPandit-nc8mi
    @TechPandit-nc8mi Год назад

    How to join python with Automation full course