Selenium Python | How to use PyTest

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

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

  • @pythonlearning5818
    @pythonlearning5818 4 года назад +5

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

  • @sirishaa80
    @sirishaa80 3 года назад +2

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

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

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

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

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

      Glad you like them Federico

  • @AyushiShinde-kc9um
    @AyushiShinde-kc9um 6 месяцев назад

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

    • @RaghavPal
      @RaghavPal  6 месяцев назад

      Awesome, thank you Ayushi

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

  • @ТикиМикк
    @ТикиМикк 3 года назад +1

    Perfect! Thank you very much for your lessons!

  • @coding-kp7rg
    @coding-kp7rg Год назад

    Thanks a lot, Raghav! Great lesson!!!

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

  • @Kumarkumar-gf3kk
    @Kumarkumar-gf3kk 4 года назад

    Awesome raghav highly appreciate for clear cut explanation

  • @RabzBoparai
    @RabzBoparai 5 лет назад +1

    Exactly what I was looking for..
    Thank you Sir

  • @6antriksh
    @6antriksh 3 года назад

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

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

      Most welcome Antriksh

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

    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  3 года назад

      I will plan a session Hassan

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

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

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

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

    Thanks, understood clearly

  • @bhavikakapadia2462
    @bhavikakapadia2462 6 лет назад +1

    Thank you so much for selenium with python course

    • @RaghavPal
      @RaghavPal  6 лет назад

      You're welcome Bhavika

  • @cayceejoel
    @cayceejoel 6 лет назад

    Thanks so much for all your step by step sessions

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

  • @tuobraun
    @tuobraun 5 лет назад

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

  • @amarhr6071
    @amarhr6071 5 лет назад

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

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

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

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

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

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

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

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

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

  • @lutony4548
    @lutony4548 5 лет назад

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

  • @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/

  • @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/

  • @lukkymaddula6302
    @lukkymaddula6302 5 лет назад

    And thanks for ur vedios that helps us a lot.

  • @krtecek-who-tries
    @krtecek-who-tries 4 года назад

    Great video, really helpful, thank you!!

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

      Glad it was helpful Maria

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

    Very useful Bro...nice👍

  • @gyan_chakra
    @gyan_chakra 5 лет назад

    Awesome explanation Sir...

    • @RaghavPal
      @RaghavPal  5 лет назад

      Happy to know it helped Bhumitra

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

  • @HarishKumar-ze5ng
    @HarishKumar-ze5ng 4 года назад +1

    Sir can we use pytest with POM?

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

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

    thanx, very helpful

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

      Glad it was helpful!

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

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

  • @Antinatalist_Rampage
    @Antinatalist_Rampage 11 месяцев назад

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

    • @RaghavPal
      @RaghavPal  11 месяцев назад

      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 11 месяцев назад

      @@RaghavPal Thanks for the suggestions.

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

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

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

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

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

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

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

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

  • @mr.s.h.818
    @mr.s.h.818 2 года назад

    I liked and subscribed your channel my friend :)

  • @arkaimps
    @arkaimps 6 лет назад

    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  6 лет назад

      Hi Arkajyoti,
      I have shown the solution in this video from ruclips.net/video/BURK7wMcCwU/видео.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

  • @Shubham-ec8ly
    @Shubham-ec8ly 6 месяцев назад

    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  6 месяцев назад

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

  • @krdaredreams
    @krdaredreams 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.

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

    Is this video comes under UI automation please reply

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

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

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

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

  • @raghuladithya7476
    @raghuladithya7476 5 лет назад

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

    • @RaghavPal
      @RaghavPal  5 лет назад

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

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

    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  3 года назад

      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

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

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

  • @ZafarDidit
    @ZafarDidit 6 лет назад

    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  6 лет назад

      Hi, try to provide absolute path for gecko driver

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

  • @Awakenwithnarayana
    @Awakenwithnarayana 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

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

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

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

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

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

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

    very nice

  • @TheNishi42
    @TheNishi42 5 лет назад

    Sir can you create a POM project using pytest ..

    • @RaghavPal
      @RaghavPal  5 лет назад

      Yes, you can Romita.ruclips.net/p/PLhW3qG5bs-L9JjtXx-adxWdbjaxeRhi7h

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

    El mejor :)

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

    Need to explain yield class some more

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

    Thank You 🙂

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

  • @СеменНовиков-ч8н
    @СеменНовиков-ч8н 3 года назад

    great, thx man

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

  • @testingtrail
    @testingtrail 6 лет назад

    Pretty cool! :)

  • @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/

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

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

  • @ahmedsalahel-din1311
    @ahmedsalahel-din1311 6 лет назад

    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

  • @pratikdosi
    @pratikdosi 6 лет назад

    Good session

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

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

  • @saikumar-wn4eb
    @saikumar-wn4eb 2 года назад

    super

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

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

  • @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/

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

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

  • @arijitkar8839
    @arijitkar8839 5 лет назад

    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  5 лет назад +1

      Hi Arijit, I have shown the solution in this video from ruclips.net/video/BURK7wMcCwU/видео.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)

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