What Is Page Object Model? | pytest Framework Tutorial | Part-IX | LambdaTest

Поділитися
Вставка
  • Опубліковано 15 вер 2024
  • In this video, we'll explore how to implement the Page Object Model design pattern in pytest. Start FREE Testing: accounts.lambd...
    📢 In this Part 9 of the pytest framework tutorial series, 𝑹𝒆𝒙 𝑱𝒐𝒏𝒆𝒔 (@RexJonesII), a seasoned QA Engineer, Trainer, UA-camr, and Blogger, deep dives into creating and calling a base page and test data file, as well as shares insights on store locators and their utility in the model. Additionally, the tutorial covers executing the Page Object Model on three browsers, including Chrome, Firefox, and Edge. By the end of the tutorial, you'll have a comprehensive understanding of the Page Object Model in pytest and how to apply it while performing test automation.
    📌 𝐆𝐢𝐭𝐇𝐮𝐛: github.com/Rex...
    ➡ What is Page Object Model (POM)?
    Page Object Model (POM) is a design pattern for creating test automation frameworks in software development. It's used to organize and structure code for automated tests in a way that makes it easier to maintain and update.
    📌 𝐋𝐞𝐚𝐫𝐧 𝐦𝐨𝐫𝐞:
    📍How to store locators
    📍How to create & call Page Objects
    📍How to create a base test & test files
    𝐕𝐢𝐝𝐞𝐨 𝐂𝐡𝐚𝐩𝐭𝐞𝐫𝐬 👀
    00:01 Introduction
    03:44 Create Base Page
    18:44 Test Data
    20:30 Store Locators
    32:40 Create Page Object Files
    49:01 Create Base Test
    53:27 Create Test Scripts
    🎓 𝐩𝐲𝐭𝐞𝐬𝐭 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐇𝐮𝐛: bit.ly/3X1wjiP
    𝐑𝐞𝐥𝐚𝐭𝐞𝐝 𝐁𝐥𝐨𝐠𝐬📝
    ➡ Page Object Model (POM) In Selenium Python: bit.ly/3JBY7W4
    ➡ End To End Tutorial For pytest Fixtures With Examples: bit.ly/3XKJjJG
    ➡ pytest Tutorial - Python Selenium Test in Parallel: bit.ly/3IzwE8p
    ➡ Selenium Python Tutorial: Getting Started With pytest: bit.ly/40UMnWD
    ➡ pytest Tutorial: Executing Multiple Test Cases From Single File: bit.ly/3WOu4iB
    💬 𝐒𝐞𝐥𝐞𝐧𝐢𝐮𝐦 𝐏𝐲𝐭𝐡𝐨𝐧 𝟏𝟎𝟏 𝐜𝐞𝐫𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧: bit.ly/3vvcQvl
    Sign Up for LambdaTest! It’s FREE 🙌
    Perform scalable and reliable cross-browser compatibility testing of your website and web app on the latest mobile and desktop browsers:
    accounts.lambd...
    For questions: support@lambdatest.com 😃
    𝐄𝐱𝐩𝐥𝐨𝐫𝐞:
    🎬 Most Recent Videos: bit.ly/3PRAPyo
    📝 Blog: bit.ly/3yGVsUc
    🎓 Learning Hub: bit.ly/3fr6l4Z
    🎥 LambdaTest Customers: bit.ly/2TB7pvD
    🚀 Webinars: bit.ly/37i41co
    🛠️ Product Updates: bit.ly/3717NGO
    💬 LambdaTest Certifications: bit.ly/3XwW0b0
    𝐂𝐨𝐧𝐧𝐞𝐜𝐭 𝐰𝐢𝐭𝐡 𝐋𝐚𝐦𝐛𝐝𝐚𝐓𝐞𝐬𝐭:
    👥 COMMUNITY: bit.ly/3Aiz5oO
    🛠️ UA-cam: bit.ly/3rH2Yfh
    🌎 LINKEDIN: bit.ly/3xA6F84
    👥 FACEBOOK: bit.ly/37mbQOa
    🐦TWITTER: bit.ly/3Cn0g3A
    🖼️ GITHUB: bit.ly/3jowfYs
    🔴 NEWSLETTER: bit.ly/3juhxzc
    📸 PINTEREST: bit.ly/2VCXI05
    #lambdatestyourapps #pytest #pageobjectmodel #howtoinstallpytest #pyteststepbystep #gettingstartedwithpytest #pytesttutorial #pytestsetup #learnpytest #pytesttutorial #pytest #learnpytest #pytestforbeginners #seleniumpython
    Disclaimer:
    This video features materials protected by the Fair Use guidelines of Section 107 of the Copyright Act. All rights reserved to © 2023 LambdaTest. Any illegal reproduction of this content will result in immediate legal action.

КОМЕНТАРІ • 24

  • @LambdaTest
    @LambdaTest  Рік тому +1

    📌 GitHub Repo:
    github.com/RexJonesII/PytestTutorials

  • @nandhakumar.g142
    @nandhakumar.g142 Рік тому

    Thanks much Rex, Love from India 🫰❣️

    • @LambdaTest
      @LambdaTest  Рік тому +1

      Subscribe, and look forward to more such tutorials! ✨

  • @devarajsnaidu3168
    @devarajsnaidu3168 5 місяців тому +1

    @LamdaTest
    Am getting unresolved driver attribute in pytest testcase when we initialize loginpage in pytest testcase
    loginpage=Loginpage(self.driver)
    Could you help me on this

    • @LambdaTest
      @LambdaTest  5 місяців тому

      Hey there,
      It sounds like you're encountering an issue with accessing the driver attribute within your pytest test case, particularly when you're trying to initialize an instance of LoginPage. This issue commonly occurs due to a few reasons, such as the driver not being properly set up or passed to the test method, or perhaps a scope issue within your test class.
      Without seeing the full code, I'll provide a general approach to troubleshoot and potentially resolve this issue:
      Ensure Proper Initialization of driver
      Firstly, make sure that self.driver is correctly initialized within your test class. This is typically done in a setup method, which is executed before each test method runs.
      Use of self.driver
      In the code snippet you provided, loginpage=LoginPage(self.driver), it appears within a class method where self.driver should be accessible assuming self.driver has been correctly initialized as part of the class instance. Make sure that self.driver is initialized in a method that runs before your test methods, such as a setup method annotated with @pytest.fixture.
      Passing the driver to the Test Method
      If your test methods are designed to receive the driver as an argument, ensure you're using a pytest fixture to inject the driver into them.

  • @trevor7481
    @trevor7481 4 місяці тому +1

    Whats up rex 💯

  • @vishalloke
    @vishalloke 6 місяців тому +1

    Why the intelligecne is not working in pycharm driver. is now showing ftind_element method

    • @LambdaTest
      @LambdaTest  6 місяців тому

      Hey there,
      If IntelliSense is not working in PyCharm for the find_element method, it might be due to a few common issues:
      - IDE Configuration: Ensure that PyCharm is correctly configured for your Python environment and that the Selenium package is properly installed in the interpreter you're using.
      - Selenium Version: Check if you're using a recent version of Selenium. The method signatures and APIs can change between versions, and PyCharm's IntelliSense might not recognize methods if there's a mismatch.
      - Indexing Issues: Sometimes, PyCharm may not have fully indexed your project or the external libraries. Try invalidating caches and restarting PyCharm (File > Invalidate Caches / Restart).
      Make sure your setup aligns with these points for IntelliSense to work correctly.

    • @vishalloke
      @vishalloke 6 місяців тому +1

      @@LambdaTest I have done all these still my intellisense is not working, could you please help me I am using lambdatest for the same

    • @LambdaTest
      @LambdaTest  5 місяців тому

      Hey there,
      Can you share more about your project with us at support@lambdatest.com
      We would be happy to help :)

  • @LanaBegunova
    @LanaBegunova Рік тому

    Thank you Rex!

  • @meghap3364
    @meghap3364 Рік тому

    Thank you Rex :)

    • @LambdaTest
      @LambdaTest  Рік тому

      Glad you liked it 😊
      Subscribe to our channel for more such tutorials! ✨

  • @meghap3364
    @meghap3364 Рік тому +1

    Rex i have a question , what is the use of Locators file , when we are adding page wise locators and their methods in pages

    • @LambdaTest
      @LambdaTest  Рік тому +3

      Hey Megha 👋🏻
      The "Locators" file is a separate file where you define the selectors for elements on your web pages. It centralizes the locators used across multiple pages, improving code organization and reusability. By separating locators, you can easily update them in one place and promote code maintenance. Page files can import and use these locators, keeping them focused on page-specific methods and actions.

  • @alexanderkomanov4151
    @alexanderkomanov4151 Рік тому

    Thanks a lot!

    • @LambdaTest
      @LambdaTest  Рік тому

      You're welcome!
      Subscribe, and look forward to more such tutorials! ✨

  • @phatle4855
    @phatle4855 6 місяців тому

    thanks sir

    • @LambdaTest
      @LambdaTest  6 місяців тому

      Glad you liked it!
      Please subscribe to the channel for more such video tutorials🙂