Selenium Python | How to use PyTest

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024

ความคิดเห็น • 233

  • @pythonlearning5818
    @pythonlearning5818 4 ปีที่แล้ว +4

    Exactly what i was looking for !... Thank you sir ... I highly recommend for beginners in python frame work....

  • @AyushiShinde-kc9um
    @AyushiShinde-kc9um 3 หลายเดือนก่อน

    Very precise and understandable. Now I am going to watch other tutorials of yours as well.

    • @RaghavPal
      @RaghavPal  3 หลายเดือนก่อน

      Awesome, thank you Ayushi

  • @sirishaa80
    @sirishaa80 3 ปีที่แล้ว +1

    well explained and easy to follow and understand. Thank you Raghav.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Most welcome

  • @robertsorbet5729
    @robertsorbet5729 4 ปีที่แล้ว +1

    Everything is understandable, I wrote tests in my company based on your videos and even got a job thanks to them. I wonder how i can pass variable from one test to another in pytest, i now that is now best solution. I know there was such a thing as Namespace before, but it was removed from Pytest 4.0

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Robert, happy to know. You can store a value in global variable or some common location (properties) and refer from here. Can check online for more ways and examples.

  • @jacoby8934
    @jacoby8934 5 ปีที่แล้ว +2

    Raghav, Great video and explanation!
    Few questions if i may:
    1. What frame work would you suggest to work with, UnitTest or PyTest?
    2. Do you have by chance some guide/video for setup page object model with PyTest? i know you have POM video with UnitTest.
    Thanks again and continue with the great work!

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว +1

      Hi Jacob, thanks for watching
      1. Pytest
      2. You can check here - automationstepbystep.com/online-courses/

    • @kamilnecas4996
      @kamilnecas4996 4 ปีที่แล้ว

      ​@@RaghavPal Hello Raghav, thank you for this tutorial. Regarding the second question from Jacob, you are referencing to your website. However, I am trying to find Page Object Model done with PyTest and unfortunatelly, I am not able to find it. Same as Jacob, I know about the POM video with UnitTest but not with PyTest. Would you please advise? Thank you very much.

  • @federicopalacio5349
    @federicopalacio5349 3 ปีที่แล้ว

    Raghav you're the master of straightforward tutorials, thanks.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Glad you like them Federico

  • @swamyas5668
    @swamyas5668 3 ปีที่แล้ว

    I was looking for pytest and got so happy after a lesson listed from you on youtube. Writing this comment before watching as I know it would be really helpful by default
    Thanks Raghav :)

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      You're very welcome!

  • @anupriyapande872
    @anupriyapande872 ปีที่แล้ว

    Thanks a lot Raghav for very informatory video.

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      So nice of you Anupriya

  • @RabzBoparai
    @RabzBoparai 4 ปีที่แล้ว +1

    Exactly what I was looking for..
    Thank you Sir

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +2

      You're welcome Rabz

  • @ТикиМикк
    @ТикиМикк 3 ปีที่แล้ว +1

    Perfect! Thank you very much for your lessons!

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Most welcome

  • @Binolnc
    @Binolnc 5 ปีที่แล้ว +1

    Thanks a lot, Mr. Raghav! Your videos are easy to understand. Already subscribed and liked!

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว +1

      You're welcome Albino. Thanks for watching

  • @fattahsamit
    @fattahsamit ปีที่แล้ว

    Thanks, understood clearly

  • @6antriksh
    @6antriksh 3 ปีที่แล้ว

    Well explained, Thank you for sharing the knowledge. Keep going on.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Most welcome Antriksh

  • @Kumarkumar-gf3kk
    @Kumarkumar-gf3kk 4 ปีที่แล้ว

    Awesome raghav highly appreciate for clear cut explanation

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Thanks Kiran

  • @VedicEnglishFormula
    @VedicEnglishFormula 4 ปีที่แล้ว

    Nice, I got some knowledge from this video..thank you

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Nice to know that

  • @bhavikakapadia2462
    @bhavikakapadia2462 6 ปีที่แล้ว +1

    Thank you so much for selenium with python course

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      You're welcome Bhavika

  • @coding-kp7rg
    @coding-kp7rg ปีที่แล้ว

    Thanks a lot, Raghav! Great lesson!!!

  • @cayceejoel
    @cayceejoel 6 ปีที่แล้ว

    Thanks so much for all your step by step sessions

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      You're welcome Joel

  • @singh07neeraj
    @singh07neeraj 4 ปีที่แล้ว

    Thank you I was looking for that tutorial. Now I can learn step by step :)

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      You’re welcome 😊Neeraj

  • @hassanmahmood2114
    @hassanmahmood2114 2 ปีที่แล้ว

    Well explained about the use of PyTest in a clear way. Very helpful !!!
    Can you just expalin a little bit about the use and purpose of "Yield" keyword?? It will be very helpful

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      I will plan a session Hassan

  • @mr.s.h.818
    @mr.s.h.818 2 ปีที่แล้ว

    I liked and subscribed your channel my friend :)

  • @skkkks2321
    @skkkks2321 4 ปีที่แล้ว

    Great job Raghav,Curious to know more about different frameworks.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Thanks for watching

  • @amarhr6071
    @amarhr6071 5 ปีที่แล้ว

    Raghav your post is very informative and easy to understand, thanks alot :)

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      You're welcome Amar

  • @varunkaniyala6302
    @varunkaniyala6302 4 ปีที่แล้ว

    Very useful Bro...nice👍

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Thanks Varun

  • @tarektaghouti
    @tarektaghouti 3 ปีที่แล้ว

    thanx, very helpful

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Glad it was helpful!

  • @gyan_chakra
    @gyan_chakra 5 ปีที่แล้ว

    Awesome explanation Sir...

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Happy to know it helped Bhumitra

  • @sandeepb248
    @sandeepb248 5 ปีที่แล้ว

    Hi Raghav. Nice video and thank you for sharing. Where are the results of the test run saved, when using PyTest? Like default reports of JUnit or NUnit?

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Sandeep, we can add options to create and store results for e.g. to create junit styled report
      pytest --junitxml=path
      To create result log files
      pytest --resultlog=path
      You can also create html reports - pypi.org/project/pytest-html/
      Can see tutorials here automationstepbystep.com/online-courses/

  • @krtecek-who-tries
    @krtecek-who-tries 4 ปีที่แล้ว

    Great video, really helpful, thank you!!

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Glad it was helpful Maria

  • @pythonlearning5818
    @pythonlearning5818 4 ปีที่แล้ว

    very nice

  • @arkaimps
    @arkaimps 5 ปีที่แล้ว

    Hey Raghav,
    Very detailed and very illustrative.
    I followed your 14 videos on selenium with Python; and was playing around with pytest.
    But got stuck in a situation, where I am trying to use or call another user defined module into my python file.
    Below error is always been thrown. I googled and few suggested to remove __init__.py file and then it will work. But that file is not getting deleted because some dependencies.
    (venv) C:\Users\arkaj\PycharmProjects\SampleProject1\TestCases>pytest test_userlogin_TC03.py
    ============================test session starts =============================
    platform win32 -- Python 3.7.1, pytest-3.9.3, py-1.7.0, pluggy-0.8.0
    rootdir: C:\Users\arkaj\PycharmProjects\SampleProject1\TestCases, inifile:
    plugins: allure-adaptor-1.7.10
    collected 0 items / 1 errors
    ==============================ERRORS ====================================
    ___________________ ERROR collecting test_userlogin_TC03.py ___________________
    ImportError while importing test module 'C:\Users\arkaj\PycharmProjects\SampleProject1\TestCases\test_userlogin_TC03.py'.
    Hint: make sure your test modules/packages have valid Python names.
    Traceback:
    test_userlogin_TC03.py:4: in
    import Screenshots
    E ModuleNotFoundError: No module named 'Screenshots'
    Can you please help. Strange thing is that when I am importing in my code, it is getting imported but when trying to run with pytest then above error is thrown.
    Please suggest.

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Arkajyoti,
      I have shown the solution in this video from th-cam.com/video/BURK7wMcCwU/w-d-xo.html. Please check. I have the complete course on Udemy here - www.udemy.com/selenium-python-step-by-step-for-beginners/
      User Coupon - DISCOUNT_UDEMY

  • @tuobraun
    @tuobraun 5 ปีที่แล้ว

    What is better to use for easier and simple Page Object Model implementation: pyttest or unittest?

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว +1

      Go with Pytest

  • @lukkymaddula6302
    @lukkymaddula6302 5 ปีที่แล้ว

    And thanks for ur vedios that helps us a lot.

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      You're welcome

  • @lutony4548
    @lutony4548 5 ปีที่แล้ว

    Hi Raghav, I just changed my project settings > project interpreter> inherit global site-packages, which solve the problem. Thanks

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Glad to know that.

  • @bhangra20001
    @bhangra20001 4 ปีที่แล้ว

    HI Raghav, I am working on the API testing in Python and I am unable find a solution to whitespace and any symbol that is in the json file. I am doing a data driven testing using csv file to verify data against the api call. It fails in the description due to whitespace and symbols such as ? + **. How to resolve this issue?
    def read_test_data_from_csv():
    test_data = []
    with open("datatest.csv", newline='') as csvfile:
    data = csv.reader(csvfile, delimiter=',')
    next(data) # skip header row
    for row in data:
    test_data.append(row)
    return test_data
    @pytest.mark.parametrize("id,resourcetype,source,name,concept_class,description",read_test_data_from_csv())
    def test_using_csv_get_location_data_check_place_name(id,resourcetype,source,name,concept_class,description):
    response = requests.get(f"api/{id}")
    response_body = response.json()
    assert response.status_code == 200
    assert response_body["id"] == id
    assert response_body["type"] == resourcetype
    assert response_body["source"] == source
    assert response_body['display_name'] == name
    assert response_body['concept_class'] == concept_class
    assert response_body['extras']['Description'] == description

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Pete, You can use some python json library to ensure the json format is correct

  • @sireeshamuthineni7632
    @sireeshamuthineni7632 3 ปีที่แล้ว

    Hi Raghav ,
    That was very well explained. Thanks a Lot.
    Can we use Webdriver Manager for browsers under Setup Method? If so can you show how can that be used.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Hi Sireesha, you can as long as you are able to connect with the required class. I will plan a session

    • @sireeshamuthineni7632
      @sireeshamuthineni7632 3 ปีที่แล้ว

      @@RaghavPal Thanks Rahav!!

  • @СеменНовиков-ч8н
    @СеменНовиков-ч8н 2 ปีที่แล้ว

    great, thx man

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Most welcome

  • @agglo-meration9442
    @agglo-meration9442 3 ปีที่แล้ว +1

    Sir how to use it to the website where there is a captcha to type? I did like yours but it didnt wait for me to write captcha.
    I want to automate from excel sheet to the web browser and needed to write captcha.
    I am planning to automate multiple data at a time

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Hi, Captcha is to prevent robots or automated scripts mimic humans. So ideally we should not automate Captcha, However there are ways to handle it. I will say check the following
      1. How imp is to automate this scenario
      2. Check the time and effort required
      3. Check with your dev team if Captcha can be disabled in testing env
      4. Check with your team if a static Captcha be provided in QA env

  • @ShruthiMudigonda
    @ShruthiMudigonda ปีที่แล้ว

    Hello Raghav, Do you have any live tutorial coming up for python selenium and pycharm with pytest framework?

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Hi Shruthi
      I have recently started Python Selenium on Pycharm 2023. Check here - automationstepbystep.com/

  • @srikanthbolisetty1417
    @srikanthbolisetty1417 4 ปีที่แล้ว

    Thanks, Raghav for the session. Once again easy to understand, and it is really helpfully helpful. is there a session related to the Pytest, Gherkin - BDD framework. Please guide

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Not yet Srikanth, but will create in some time. You can find all here - automationstepbystep.com/

    • @srikanthbolisetty1417
      @srikanthbolisetty1417 4 ปีที่แล้ว

      Thanks Raghav!

  • @vikramdhoke6809
    @vikramdhoke6809 4 ปีที่แล้ว

    Hi, thank you for explaining these concepts, I only have one doubt - in unittest we use unittest.testsuite to create our testsuite, then how can we build testsuite in pytest, what is the alternative for unittest.testsuite in pytest??

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Hi Vikram, this can help - docs.pytest.org/en/stable/unittest.html

    • @vikramdhoke6809
      @vikramdhoke6809 4 ปีที่แล้ว

      @@RaghavPal Thank you for your help!

    • @vikramdhoke6809
      @vikramdhoke6809 4 ปีที่แล้ว

      @@RaghavPal I have gone through it, but if that's the case then it would become mandatory that we must use unittest with pytest, in cases where testsuite is required and this also mean that we will have support of some pytest features with boilerplate code of unittest

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Let me explore more on that Vikram and will update or create a session

  • @saikumar-wn4eb
    @saikumar-wn4eb 2 ปีที่แล้ว

    super

  • @carlosalbertopingoaguilar9614
    @carlosalbertopingoaguilar9614 2 ปีที่แล้ว

    El mejor :)

  • @hareeshpd1283
    @hareeshpd1283 2 ปีที่แล้ว

    Thank You 🙂

    • @hareeshpd1283
      @hareeshpd1283 2 ปีที่แล้ว

      Just done my first pytest 👍👍

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว +1

      most welcome

  • @gayatrireddy4112
    @gayatrireddy4112 ปีที่แล้ว

    Hello sir, by using python pytest we can open installed applications?....how we will use for browser application that is selenium

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Hi Gayatri, you just need to add Selenium lib and use its functions as shown

  • @testingtrail
    @testingtrail 6 ปีที่แล้ว

    Pretty cool! :)

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว +1

      thanks for watching

  • @lutony4548
    @lutony4548 5 ปีที่แล้ว +1

    Hi Raghav, very good tutorial, appreciate it.
    My problem for using pytest is: I cannot import pytest, I checked my installation, everything is doing as per your video, please help on this.
    Thanks
    Tony

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว +1

      Hi Lu Tony, as per your other comment you resolved it. You can just reply to the same comment to set context, I am putting your comment here:
      Hi Raghav, I just changed my project settings > project interpreter> inherit global site-packages, which solve the problem. Thanks

    • @BhupendraSadayeHORNOKPLZ
      @BhupendraSadayeHORNOKPLZ 4 ปีที่แล้ว

      @@RaghavPal Thank you this navigation solved my issue. Just to add after above steps.
      1. Go to 'Python Interpreter' in your project.
      2. Click on Setting icon.
      3. New Env will be there bydefault let it be
      4.In Location path just add any character to end. It creates new folder(virtual environment) like mine was 'venv' and I changed to 'venva' added a letter.
      5. Click two checkboxes below path to inherit and make available.
      6.Now you'll able to see 'ok' button enabled which was earlier disabled, click and its done.
      7.you' can see your new virtual Env folder in your structure..
      ((PS : I was getting Error "ModuleNotFoundError: No module named 'pytest' ") and it was solved

  • @LuvxJacqu4li8e
    @LuvxJacqu4li8e 2 ปีที่แล้ว

    Need to explain yield class some more

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      I will do a session

  • @venkateshr5461
    @venkateshr5461 2 ปีที่แล้ว +1

    sir my pytest not collect the items (it's showing Collecting 0 items when i run my test)
    how to fix this? plz help😕

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Venkatesh, will need to check details and logs

    • @venkateshr5461
      @venkateshr5461 2 ปีที่แล้ว

      @@RaghavPal Sir my installation setup was correct (i think it's root dir fault ) How to i set correct root dir in my pycharm explain?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      this can help www.jetbrains.com/help/pycharm/configuring-project-structure.html#:~:text=Create%20a%20content%20root%EF%BB%BF,to%20configure%20content%20roots%20for.&text=In%20the%20dialog%20that%20opens,desired%20directory%20and%20click%20OK.

  • @VetriJ
    @VetriJ 3 ปีที่แล้ว

    wow,good code for beginners.. it is working perfectly. Can I add HTML runner on this code? i

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Yes, you can try

    • @VetriJ
      @VetriJ 3 ปีที่แล้ว

      @@RaghavPal I tried with import unittest and unittest.main (.......). It is showing the error, unnittest not defined

  • @pratikdosi
    @pratikdosi 6 ปีที่แล้ว

    Good session

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      Thanks Pratik

  • @pythonlearning5818
    @pythonlearning5818 4 ปีที่แล้ว

    Sir, one request kindly do a video for one strong frame work full on any specific website please .. For eg: Orange HRM end to end frame work please.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Sure, I will do

  • @cayceejoel
    @cayceejoel 6 ปีที่แล้ว

    Can you in the future deal with of advice on how to interact with like a flight or hotel reservation filters in Python?

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      I will try to take that into consideration Joel

  • @Antinatalist_Rampage
    @Antinatalist_Rampage 9 หลายเดือนก่อน

    hey, the login button id is not longer there on the inspect elements. what should I use instead?

    • @RaghavPal
      @RaghavPal  9 หลายเดือนก่อน

      Losing the login button ID in Inspect Elements can be frustrating, but don't worry, there are still ways to identify and interact with the button! Here are some options you can consider:
      1. Look for alternative identifiers:
      Class names: Look for unique class names associated with the button. Often, buttons have specific class names for styling or functionality that you can use for identification.
      Data attributes: Many elements use custom data attributes for various purposes. Look for attributes like data-login, data-submit, or specific attributes related to the button's function.
      Text content: If the button has unique text content like "Log In" or "Sign In," you can use cy.contains in Cypress to locate it.
      Accessibility attributes: Elements often have accessibility attributes like aria-label or role that describe their purpose. Identifying buttons using these attributes can be a reliable approach.
      2. Use relative positioning:
      If the button has a consistent relationship with other elements on the page, you can use relative positioning based on those elements. For example, you could locate the button as "the next sibling of the element with class 'header-logo'".
      3. Shadow DOM exploration:
      Some web frameworks use Shadow DOM to encapsulate components. If you suspect the button might be hidden within Shadow DOM, you can use libraries like cypress-shadow-dom or framework-specific methods to access and interact with it.

    • @Antinatalist_Rampage
      @Antinatalist_Rampage 9 หลายเดือนก่อน

      @@RaghavPal Thanks for the suggestions.

  • @raveendratangella6122
    @raveendratangella6122 5 ปีที่แล้ว

    Testing or developer which course is better in future

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Both are good and depends on your interests and passion. If you want to go in testing consider automation testing

  • @prahalladachar7659
    @prahalladachar7659 5 ปีที่แล้ว

    Perfect bro

    • @prahalladachar7659
      @prahalladachar7659 5 ปีที่แล้ว

      Your mail ID please.. My number 9986076786

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว +1

      Hi Prahallad, Thanks for watching, You can put your query and messages here, I check the messages here more often than on emails

  • @swastikasoumya119
    @swastikasoumya119 5 ปีที่แล้ว

    Hello Raghav, thanks for your videos.They are very informative. Can you please also do this using eclipse as in eclipse we don't have terminal .Also when I run through command prompt , I don't get any results printed . Do I need to choose pyCharm or continue using Eclipse IDE .Kindly guide , I also want to keep using the same IDE to link my project to Jenkins and Maven.

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Swastika, if you have installed python on your system and added pydev in eclipse, you can continue with eclipse. Although as PyCharm is built for python projects, it may be more easier to follow. You can just install it and get started

    • @swastikasoumya119
      @swastikasoumya119 5 ปีที่แล้ว +1

      @@RaghavPal ..Thank you for suggesting..

  • @raveendratangella6122
    @raveendratangella6122 5 ปีที่แล้ว

    Selenium with python automation testing is better in future? Please reply

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Raveendra, yes Selenium with Python is a v good skill and is also in demand.

  • @HarishKumar-ze5ng
    @HarishKumar-ze5ng 4 ปีที่แล้ว +1

    Sir can we use pytest with POM?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Yes Harish

    • @HARISH-xu7nt
      @HARISH-xu7nt 4 ปีที่แล้ว

      @@RaghavPal Thank you sir

  • @Shubham-ec8ly
    @Shubham-ec8ly 3 หลายเดือนก่อน

    hi sir
    after installation of pytest and checking the version it is still giving me below error
    C:\Users\91956>pytest
    'pytest' is not recognized as an internal or external command,
    operable program or batch file.

    • @RaghavPal
      @RaghavPal  3 หลายเดือนก่อน

      Shubham
      Here are a few steps you can follow to resolve this issue:
      1. Install pytest in PyCharm:
      - Open PyCharm.
      - Go to File > Settings > Project: \ > Python Interpreter.
      - In the search bar, type "selenium" and click on the "+" button to install it².
      2. Check Python Interpreter:
      - Make sure that the Python interpreter you're using in PyCharm is the same one where you installed pytest.
      - You can verify this by going to File > Settings > Project: \ > Python Interpreter and ensuring that the correct interpreter is selected.
      3. Verify Selenium Installation:
      - Sometimes, issues can arise due to missing or incorrect installations.
      - Open a terminal/command prompt and run the following command to check if Selenium is installed:
      ```
      pip show selenium
      ```
      - If it's not installed, you can install it using:
      ```
      pip install selenium
      ```
      4. Restart PyCharm:
      - After making any changes, restart PyCharm to ensure that the changes take effect.
      5. Path Environment Variable:
      - Ensure that the directory containing the pytest executable is included in your system's PATH environment variable.
      - You can add the path to the directory where pytest is installed to your system's PATH.
      6. Check for Typos:
      - Double-check that you're running the correct command. It should be:
      ```
      pytest
      ```
      - Make sure there are no typos or misspellings.
      --

  • @mohammadvali675
    @mohammadvali675 2 ปีที่แล้ว

    how write about Gmail test scripts by using pytest, and calling to into other files. Help me

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Vali, will need to check online for this

  • @hassanmahmood2114
    @hassanmahmood2114 2 ปีที่แล้ว

    I am facing an error while running my code. The browser opens but closes within few seconds without getting the URL of the website. How I can share my code with you?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Hassan, check if you are using the same version of browser driver as the browser ver on your system, also check other related comments

  • @cayceejoel
    @cayceejoel 6 ปีที่แล้ว +1

    Can you help, after creating functions I get "Process finished with exit code 0" but it didn't run.

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      Hi Joel. pls check the following:
      1. pytest was installed properly: on cmd run pip check pytest
      2. ensure the name of python file has format test_*.py OR *_test.py
      3. the function name has test_ in the start of the name
      4. In case you are defining a class, its name should start with Test
      5. On command-line you have to run it with command pytest or py.test or python -m pytest (as shown in video)

    • @cayceejoel
      @cayceejoel 6 ปีที่แล้ว

      I followed step by step, could it be the path for my webdriver. Before defining the function it ran fine and smooth.

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      Do you get any logs for this.
      Pls check the video again, just in case you have missed anything.

    • @cayceejoel
      @cayceejoel 6 ปีที่แล้ว

      @@RaghavPal Thanks for your reply. No logs . Do I have to Enable pytest as Default test runner from the Settings/Tools ?

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      Hi Joel, if you try to run from command line with -v flag:
      pytest -v
      you should get some logs & information.
      Pls check

  • @ZafarDidit
    @ZafarDidit 5 ปีที่แล้ว

    down vote
    favorite
    I installed a virtual environment and then inside installed selenium, py.test and webdriverdownloader furthermore I set up a system environment variable and added path to geckodriver
    But when I executed Python test from command line it fails with error : geckodriver executable needs to be in path
    what went wrong from my side?

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi, try to provide absolute path for gecko driver

  • @historinhasdivertidas5712
    @historinhasdivertidas5712 3 ปีที่แล้ว

    is there any course of what one QA Tester has to know in database? practice

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Not a separate course yet

  • @raveendratangella6122
    @raveendratangella6122 5 ปีที่แล้ว

    Which is better course selenium with java or selenium with python

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Both are good and depends on needs. No of jobs with Selenium Java are more but the skills available are also huge. If you can learn Selenium with Python that will help a lot.

  • @ksk6394
    @ksk6394 3 ปีที่แล้ว

    Can we use TestNG with Python?,is it possible? if not possible which one is better.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Hi, can check this stackoverflow.com/questions/45323248/how-to-achieve-testng-like-feature-in-python-selenium-or-add-multiple-unit-test

  • @shilpakothapalli8866
    @shilpakothapalli8866 4 ปีที่แล้ว

    Hi sir ,am getting module 'unittest' has no attribute 'testcase'

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Shilpa, can you try diff ver of pytest and check. Also check this
      github.com/coala/coala-bears/issues/2862

  • @teodorogar2475
    @teodorogar2475 4 ปีที่แล้ว

    Hi! Why I'm not able to se the prints() During the execution?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Teodoro, let me know the time in the video and I will check

    • @teodorogar2475
      @teodorogar2475 4 ปีที่แล้ว

      @@RaghavPal Oh I meant that in every single of your runs, I see a -> print("Test ended") but is not actually showing at the end of the runs/logs
      . greetings

  • @raghuladithya7476
    @raghuladithya7476 4 ปีที่แล้ว

    Hi Ragav, Can we do a customised automation framework in Python ?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Raghul, there is a course on Udemy on that - pls check - automationstepbystep.com/udemy-discounts/

  • @nehareddy5799
    @nehareddy5799 3 ปีที่แล้ว

    Is this video comes under UI automation please reply

  • @supriya.ssuresh296
    @supriya.ssuresh296 2 ปีที่แล้ว

    Cannot open Local Terminal
    Failed to start [powershell.exe] in C:/Users/Putty/PycharmProjects/pythonProject/Q45M3/program/Pytest/pytest
    Error running process: CreateProcess failed. Code 2
    See IDE log (Help | Show Log in Explorer) for the details.
    Im observing this error when i opened terminal
    I installed pytest in command prompt as shown in video

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Supriya, pls check this youtrack.jetbrains.com/issue/IDEA-275325
      Can also try to use a diff version

  • @ahmedsalahel-din1311
    @ahmedsalahel-din1311 5 ปีที่แล้ว

    Hi Raghav, Thank you for the video, it is really helpful.
    When I created more than one module, it did not run from command line using any of the commands given in the video, i.e. pytest or python -m pytest
    The error is: python cannot find related modules imported in my test file....
    Thank you

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Ahmed, pls check this , there is some useful info here - stackoverflow.com/questions/24722212/python-cant-find-module-in-the-same-folder

  • @TheKhirodkumar
    @TheKhirodkumar 5 ปีที่แล้ว

    when i write this
    (venv) C:\Users\khirod\PycharmProjects\orangeHM>allure serve reports/allure-reports
    'allure' is not recognized as an internal or external command,
    operable program or batch file.
    (venv) C:\Users\khirod\PycharmProjects\orangeHM>
    i am getting this message
    i have installed allure-pytest
    what to do

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi, This is what has helped others. Pls check
      We have to manual installation of Allure
      docs.qameta.io/allure/
      and set complete path of directory of test executed folder
      1. Go to dl.bintray.com/qameta/generic/io/qameta/allure/allure
      2. Download the zip and unzip it inside the bat folder that is in your python installation, e.g. C:\Libs\Python\bat
      3. Go to edit system variable and in system section look for PATH variable and add the bin path of that allure in the path, e.g. C:\Libs\Python\bat\allure-2.7.0\bin\
      4. close and open console and it should work :)
      =====================================
      I resolved this issue. Issue is Allure is not installed in our system that is why we facing this issue.Steps how to fix this issue fro windows 10 OS:
      1. Open Power Shell and run this command : iex (new-object net.webclient).downloadstring('get.scoop.sh')
      Note: if you get an error you might need to change the execution policy (i.e. enable Powershell) with Set-ExecutionPolicy RemoteSigned -scope CurrentUser
      2. After installing Allure add environment variable under System Variable : C:\Users\test123\scoop\apps\allure\current\bin
      3. Restart your machine and allure serve /path of file will work.

  • @MayurPatil
    @MayurPatil 4 ปีที่แล้ว

    Hi Raghav,
    Do you have any github repo from which I can get code displayed in videos?
    Thanks !

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Mayur, can check this - github.com/Raghav-Pal/PythonAutomationFramework_1

  • @newlife1823
    @newlife1823 4 ปีที่แล้ว

    Thank you very much for your help I just Have a question if it possible Can I use my pytest for every Tab I open in my code I want to open tab in browser and call my pytest

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Yes, you should be able to

    • @newlife1823
      @newlife1823 4 ปีที่แล้ว

      @@RaghavPal Can you tell me how I make the pytest now it work perfetly but I don't know how to use it in parallel or how to work one by one
      Thank you again Brother

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      I will plan to add a session, Check this for now - stackoverflow.com/questions/45733763/pytest-run-tests-parallel

    • @newlife1823
      @newlife1823 4 ปีที่แล้ว

      @@RaghavPal Thank you so much brother

  • @sajnapm9248
    @sajnapm9248 4 ปีที่แล้ว

    Am not able to load the internal web applications using pytest.Can u please tell what the issue might be.It works fine with Java selenium.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Sajina, will have to see your setup and environment for that.

  • @chandanapinnaka9299
    @chandanapinnaka9299 ปีที่แล้ว

    hi, selenium python robot framework how is the market?

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Hi Chandana
      Selenium with Python:
      Selenium is a popular open-source automation framework for web application testing, and Python is a widely used programming language in the automation testing domain. The combination of Selenium and Python provides a powerful toolset for automating web testing tasks
      The market for Selenium with Python is quite strong, as many companies and organizations leverage these technologies for their web application testing needs. Python's simplicity, readability, and extensive libraries make it a preferred choice for automation testers. Therefore, learning Selenium with Python can be beneficial in terms of career opportunities and market demand.
      Robot Framework:
      Robot Framework is another popular open-source automation framework that offers a keyword-driven approach for test automation. It provides a simple and readable syntax that allows testers to create test cases using keywords and reusable test libraries. Robot Framework supports various test automation aspects, including web testing, API testing, and mobile testing. It has a vibrant and active community, which contributes to its continuous growth and improvement
      The market for Robot Framework is also promising, with many organizations adopting it for their automation testing needs. Its keyword-driven approach, easy-to-read syntax, and extensibility make it appealing to both technical and non-technical users. The versatility of Robot Framework, allowing integration with other tools and technologies, further adds to its market value.

  • @lukkymaddula6302
    @lukkymaddula6302 5 ปีที่แล้ว

    Hi raghav could you please make a vedio on python selenium.

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Lukky, I have a Udemy course on it
      www.udemy.com/selenium-python-step-by-step-for-beginners/
      You can try coupon code - DISCOUNT_UDEMY_SE
      For other courses - automationstepbystep.com/909-2/online-course

  • @kondaReddydreams
    @kondaReddydreams 5 ปีที่แล้ว

    Hi Sir, Please let me know how to integrate pycham code with jenkins.

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Konda, In jenkins you can add the command from your pycharm project. That will be the best and straight-forward way.

  • @satyanarayanswamy
    @satyanarayanswamy 4 ปีที่แล้ว

    global drive is showing error , driver is not defined . Can you please help ?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Satyanarayan, pls check if you have imported the libraries properly. Cross check with the video

  • @ayyajjamadar6387
    @ayyajjamadar6387 4 ปีที่แล้ว

    sir you have udemy course for Pytest ?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Ayyaj, you can check all Udemy courses here - automationstepbystep.com/udemy-discounts/

  • @TheNishi42
    @TheNishi42 5 ปีที่แล้ว

    Sir can you create a POM project using pytest ..

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Yes, you can Romita.th-cam.com/play/PLhW3qG5bs-L9JjtXx-adxWdbjaxeRhi7h.html

  • @syedquadri2920
    @syedquadri2920 5 ปีที่แล้ว +1

    when i'm trying to download pytest i'm facing issues connection to PyPi.org Timed Out

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Syed, are you behind corporate firewall, If yes you can try this command
      pip install --proxy domain\user:password@proxyaddress:port package
      github.com/pypa/pip/issues/4417

  • @jalalkasmani2575
    @jalalkasmani2575 5 ปีที่แล้ว

    Hi raghav
    How can I create exe for the parallel testing with pytest. I am trying to automate file download in parallel proceess for the team . I goggled and tried still no luck. Can you kindly help advise?

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Jalal, you want to create exe file of the project? I will like you know your scenario for this.

    • @jalalkasmani2575
      @jalalkasmani2575 5 ปีที่แล้ว

      @@RaghavPal Yes, i want to run the parallel downloads at the users PC where python is not installed.
      My code is in 2 of the .py files which i am currently running codes at my own PC and i am thinking how can i deploy this to the users .
      Name of my first py file is TkintersApp.py and has the below code.
      import pytest
      from selenium import webdriver
      from selenium.webdriver.common.keys import Keys
      from test_twotest import test_first
      from test_twotest import test_second
      def RunBoth():
      #pytest.main(["-s","-v","-n 3"])
      pytest.main(["test_twotest.py","-n 2"])

      from tkinter import *
      window = Tk()
      window.configure(bg="lightblue")
      window.geometry("300x150+120+120")
      window.resizable(width=False, height=False)
      window.title("IFW Form")
      entry1 = Entry(window)
      entry2 = Entry(window,show="*")
      entry1.grid(row=0,column=1)
      entry2.grid(row=1,column=1)
      LoginButton = Button(window,text="Login", command=RunBoth, height=1,width=12)
      LoginButton.grid(row=2,column=0)
      window.mainloop()
      Name of the second .py file is test_twotest and has the below code.
      from selenium import webdriver
      from selenium.webdriver.common.keys import Keys
      def test_first():
      driver = webdriver.Chrome("C:\\Selenium Drivers\\chromedriver.exe")
      driver.get("www.facebook.com")
      def test_second():

      driver = webdriver.Chrome("C:\\Selenium Drivers\\chromedriver.exe")
      driver.get("www.facebook.com")

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      You should be using Version control system for this

    • @jalalkasmani2575
      @jalalkasmani2575 5 ปีที่แล้ว

      @@RaghavPal thanks for the response sir, can you please direct me where can I get the used case for this.

  • @p-a5603
    @p-a5603 5 ปีที่แล้ว

    Is this "global" driver approach standard?

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Peter, You can either make it global or inherit the class (inheritance)

  • @sivajyothichandra
    @sivajyothichandra 4 ปีที่แล้ว

    why we need to use class, when we can do it with functions.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Class will help you create objects and use Object Oriented Programming.. You can watch Python basics videos for more information - automationstepbystep.com/

  • @withlove_ylang
    @withlove_ylang 4 ปีที่แล้ว

    How can I express more.. Thank you Sooooo much.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      You're welcome. Do share your knowledge with others

  • @jalalkasmani2575
    @jalalkasmani2575 5 ปีที่แล้ว

    How many max chrome browser can run in parallel using pytest?

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Hi Jalal it depends on your system configurations

    • @jalalkasmani2575
      @jalalkasmani2575 5 ปีที่แล้ว

      @@RaghavPal thanks for response sir, how can I check that, can you please advise?

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว +1

      By system configuration, I mean your RAM, CPU capacity etc. Runing more threads in parallel will require more cpu capacity, memory etc.

    • @jalalkasmani2575
      @jalalkasmani2575 5 ปีที่แล้ว +1

      @@RaghavPal ok thanks

  • @raveendratangella6122
    @raveendratangella6122 5 ปีที่แล้ว

    Salary variance tester and developer?

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว

      Again depends, generally, we see Dev paid little more than Testers of same experience, but as I said in my earlier comment, if you have real passion for testing and you can get some really in demand skills, you can get paid higher.

  • @pallavisharma7300
    @pallavisharma7300 4 ปีที่แล้ว

    why to use pytest nose? please throw some light on this

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Pallavi, nose library can be used to extend the testing framework to make testing easier and efficient. I will plan to have a dedicated session on this

  • @himanshusingh7509
    @himanshusingh7509 2 ปีที่แล้ว

    otp is come in mail for login->give a video for this

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว +1

      Try checking with your dev team, can you do that with API

    • @himanshusingh7509
      @himanshusingh7509 2 ปีที่แล้ว

      @@RaghavPal OTP api workwell i require open a mail after that get a OTP

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Thats what I said, see ultimately the otp must be stored somewhere, if you have an api to call and get the value, you will not have to do the email step as it will take some time and may be flaky

  • @amiravate47
    @amiravate47 5 ปีที่แล้ว

    Hi Raghav, Thanks for the Video. I have two issues, can you help me out please?:
    1. pytest module is not available to import: prntscr.com/p6gf1w
    2. Global driver variable shows error : prntscr.com/p6ghnl

    • @RaghavPal
      @RaghavPal  5 ปีที่แล้ว +1

      Hi Amir,
      1. Check the required libraries are imported in the project
      PyCharm (File in windows) -> Preferences (Settings on Windows) -> Project -> Project InterpreterHere you can see list of libaries
      You can also click on '+' sign to add new library (python module)
      2. Why do you need it global. Also check this.confluence.jetbrains.com/display/PYH/PyCharm+193.2956.40+Release+Notes

    • @amiravate47
      @amiravate47 5 ปีที่แล้ว

      @@RaghavPal Thank you. I have liked and subscribed to your channel.

  • @anonimanonim-mp9hx
    @anonimanonim-mp9hx 6 ปีที่แล้ว

    Hi.
    How I can import file when use pytest?
    I always have a Error
    prntscr.com/l6h326 - screen

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      Hi, will need to see your steps and error logs

    • @anonimanonim-mp9hx
      @anonimanonim-mp9hx 6 ปีที่แล้ว

      Structure of my project:
      RT_python:
      .idea
      drivers
      program
      Project:
      POMRT:
      Pages:
      Home_Page.py
      Tests:
      test_home.py
      reports
      venv
      I have code - prntscr.com/l6lr3q
      But when I try to run in a command line my test, I receive error - prntscr.com/l6luem

    • @anonimanonim-mp9hx
      @anonimanonim-mp9hx 6 ปีที่แล้ว

      I solved problem with help
      "sys.path.insert(0,'../../..')"

    • @anonimanonim-mp9hx
      @anonimanonim-mp9hx 6 ปีที่แล้ว

      What you can advice? Use pytest or unittest?

    • @RaghavPal
      @RaghavPal  6 ปีที่แล้ว

      Glad to know that .
      Use Pytest, its most commonly used for frameworks and you can use many other features.
      You can also check my Udemy course on complete framework creation - www.udemy.com/selenium-python-step-by-step-for-beginners/
      Use coupon - DISCOUNT_UDEMY

  • @arijitkar8839
    @arijitkar8839 4 ปีที่แล้ว

    Traceback (most recent call last):
    File "sample.py", line 1, in
    from selenium import webdriver
    ImportError: No module named selenium
    I am facing this error. Can you please tell me how to resolve this issue?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Hi Arijit, I have shown the solution in this video from th-cam.com/video/BURK7wMcCwU/w-d-xo.html. Please check.
      stackoverflow.com/questions/10253826/path-issue-with-pytest-importerror-no-module-named-yadayadayada
      On command line go one folder up from the folder from where you have any imports in your script
      For example this is your project structure:
      ProjectFolder/Example/Demo/file.py
      In you file.py you have your code with import statements.
      Suppose one of the import is from Demo folder
      So on command line goto folder Example (parent of demo folder)
      and then say command
      python -m unittest Demo.file .
      (note do not give .py extension)