I tried this code in eclipse , didn't work---> ''' Created on 07-Jan-2019 @author: Prasad ''' from selenium import webdriver import unittest class Logintest(unittest.TestCase): @classmethod def setup (cls): cls.driver = webdriver.Chrome(executable_path="C:/GoogleChromeDriver/chromedriver.exe") cls.driver.implicitly_wait(10) cls.driver.maximize_window() def test_login_valid(self): #self.driver = webdriver.Chrome(executable_path="C:/GoogleChromeDriver/chromedriver.exe") self.driver.get("phptravels.org/clientarea.php") self.user_name=self.driver.find_element_by_name("username") self.user_name.send_keys("Dont want to share here") self.password=self.driver.find_element_by_name("password") self.password.send_keys("Dont want to share here") self.password=self.driver.find_element_by_name("password") self.driver.find_element_by_id("login").click() @classmethod def tear_down(cls): cls.driver.close() cls.driver.quit() print("Test completed..") # def login (self,username,password): ----------> Getting below error : FFinding files... done. Importing test modules ... done. ====================================================================== ERROR: test_login_valid (Login.Logintest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:/SeleniumProject/Python_Selenium/CRM_Application/com_actionables\Login.py", line 21, in test_login_valid self.driver.get("phptravels.org/clientarea.php") AttributeError: 'Logintest' object has no attribute 'driver' ---------------------------------------------------------------------- Ran 1 test in 0.004s FAILED (errors=1)
@prasadsardesai
5 жыл бұрын
but still I am enjoying it
@RaghavPal
5 жыл бұрын
Hi Prasad, looks like you missed some step. Request you to refer the video again carefully
@MsAaadil
5 жыл бұрын
where are the notes ?
@ravindersanjay
4 жыл бұрын
@@prasadsardesai Facing the same issue "AttributeError: type object "LoginTest' has no attribute 'driver'". have you got the solution for this ?
@neighbourhoodcoder5988
4 жыл бұрын
this tutorial should get more recognition.....clearly explained. keep up the good work man,Cheers!!
@RaghavPal
4 жыл бұрын
So happy to read your message Ahmed
@joshdenault6363
4 жыл бұрын
For someone new to Selenium (but not Python) this is the only video I have found that *clearly* explains POM in a easy to understand manner, from initial script, to adding test cases to formatting for POM. Well done, and thank you!
@RaghavPal
4 жыл бұрын
You're welcome Josh.
@fraven9586
2 жыл бұрын
I really liked the quality and patience with which he teaches. Please, if you could continue with more advanced cases. Greetings from Peru!
@RaghavPal
2 жыл бұрын
Hi Fraven, sure I will
@sandipkankate6821
3 жыл бұрын
I haven't seen that much crystal clear concept explanation... l'm fascinated by your teaching style and content provided by you... Thanks alott Sir👍
@RaghavPal
3 жыл бұрын
You're very welcome Sandip
@rmkkmrrmk
2 жыл бұрын
This is exactly what I needed, thank you very much for such a clear explanation!
@RaghavPal
2 жыл бұрын
Most welcome Jose Luis
@fraven9586
2 жыл бұрын
I like that it not only focuses on practice 100%, but also focuses on theory and concepts, such as the POM model.
@RaghavPal
2 жыл бұрын
Thanks Fraven
@AbrahamMike
5 жыл бұрын
Thank you so much. with your tutorials I was able to create my own selenium auto tester that goes to a shopping site login and add an item to cart. I uploaded it to my github
@RaghavPal
5 жыл бұрын
Glad to hear that Mike. Keep going
@AbrahamMike
5 жыл бұрын
@@RaghavPal Thank you sir... i subbed to your channel and will be following your tutorials...
@mmcooe
5 жыл бұрын
One point to note here is that unit tests in python recognize test cases only if prefixed with test_. Example: test_login_valid. If you don't prefix test then no error is thrown but tests run as Run 0 test in 0.00s
@tuannguyen-on1up
5 жыл бұрын
correct. you're right. And that is why he used to prefix test
@dineshkhanna963
5 жыл бұрын
Excellent video. Neat & Clear. You are good in teaching. Best video to learn Page Object Model for Python Selenium
@RaghavPal
5 жыл бұрын
Glad & humbled to know this Dinesh
@anjalikumari2295
4 жыл бұрын
Hi Raghav, Thanks to put this selenium framework using POM| Unit test| HTML reports. It was really helpful video for a beginner like me who are keen to learn about developing a sustainable framework. This video is really well structured and organized that can help anyone who does not have any prior knowledge in framework development. Coming to my query, I have imported HtmlTestRunner module and even added the report path in unittest.main(). But, when i am trying to run the script in cmd, it shows the following error : Traceback (most recent call last): File "C:\Python38-32\lib unpy.py", line 185, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "C:\Python38-32\lib unpy.py", line 111, in _get_module_details __import__(pkg_name) File "C:\Users\Anjali\PycharmProjects\Selenium-Framework\DemoProject\POMProjectDemo\Tests\login.py", line 5, in import HtmlTestRunner ModuleNotFoundError: No module named 'HtmlTestRunner' Can, You tell me where i am making mistake. Thank you in advance : )
@RaghavPal
4 жыл бұрын
Hi Anjali, so happy to know this. Keep learning and also help others
@user-bb9wy9ej9y
Жыл бұрын
This video is very very helpful for me I learned from here about POM and how to define class in main file , Thank you
@RaghavPal
Жыл бұрын
Great to know this. All the best
@Manishkansara-dq5tj
5 ай бұрын
Thank you so much for doing fantastic job, I am watching your all automation related videos and learned a lot.
@RaghavPal
5 ай бұрын
So happy and humbled to know this Manish.. keep learning
@myyouaccounttube1024
4 жыл бұрын
Awesome! Thanks a lot for this very interesting and clear course. I've recommended collegues and friends to watch these videos.
@RaghavPal
4 жыл бұрын
Awesome, thank you! Find more here - automationstepbystep.com/
@heliamordejoiti9116
3 жыл бұрын
You are definitely a role model for me. Thanks for doing a fantastic job with your videos. You're The Best Raghav. Greetings from a Venezuelan fan in Chile
@RaghavPal
3 жыл бұрын
So nice of you Heliam. Thanks a lot
@dxmayers6775
2 жыл бұрын
Thanks for your video! i am already watching this video 10 times!! this is very useful video!
@RaghavPal
2 жыл бұрын
So happy to know
@Citrich
4 жыл бұрын
It was a really wonderful experience totally worth watching every second.
@RaghavPal
4 жыл бұрын
So happy to know this Anurag
@muslimakhakimova2657
3 жыл бұрын
I am so lucky that I found this tutorial. Thank you so much. It is very clear and helpful.
@RaghavPal
3 жыл бұрын
You're very welcome Muslima
@harshbhawsar6103
2 жыл бұрын
I was baffled about POM, But you make it so easy Thank you so much ...
@RaghavPal
2 жыл бұрын
You’re welcome Harsh
@ricardodeleon8302
5 жыл бұрын
Thank you for sharing the video, just for the libraries, you can add them from pycharm in settings, also pycharm has its own command line. I’m pretty sure you know that. So if you are using a powerful IDE, take advantage of it.
@RaghavPal
5 жыл бұрын
Thanks for the info Ricardo, I believe I have shown that in some part of the video, your message will help
@aundremoodie
3 жыл бұрын
Did I say genius? Short. Sweet. And easy to understand!
@user-jd4wd3st5u
4 жыл бұрын
Thank you so much! For a long time I could not find about POM. Your video turned out to be a godsend. Best video I've ever seen
@RaghavPal
4 жыл бұрын
You're most welcome Мария
@alikhanmagomedaliev5500
2 жыл бұрын
Мария я не знаю ответите вы или нет Но я хотел бы уточнить, POM который объясняется на видео актуален как для Pytest так и для Unittest? Или POM это обособленные концепция которая работает с любым фреймворком?
@Balkac
5 жыл бұрын
Hello, thanks for nice presentation. I was looking mainly for POM explanation. I have observed following not completely well done parts: 1. in action definitions in LoginPage, it would be a little better to define an objects at first (like username_text_box, password_text_box ...) and afterthat just called method under them (username_check_box.clear(), .send_keys() etc.. Instead you have lot of code repeated. 2. Also will be better to create another method like loginIntoPage which takes arguments username and passrword, with all three previously created methods. Then you don't need call in your test all three methods for login into page, instead just one. 3. it would be good to create some BasePage class with driver initialization. Then you don't need to initialize driver for every test. 4. separate class for Locators - it is very discussable. The separation has basically no meanings (except less objects created in POM classes. But trying to find your locator in huge Locators file can be pain. And even more when you start running out of names :)
@RaghavPal
5 жыл бұрын
Hi Kral, thanks for your inputs. I might have discussed these in other videos, but still, I will check your suggestions in detail wrt the video in some time
@rckatari
2 жыл бұрын
Excellent video that covered all basics of Unit Testing, thank you!
@RaghavPal
2 жыл бұрын
You're very welcome Ravi
@cristiancruciani3603
2 жыл бұрын
Thanks Amigo!! I was watching a lot of pom videos but they left me doubts, but you cleared my mind about POM. good video, with a plan, ordered and you were making progress on each item. and I stay clear and calm :) and ++ you taught me some about python!!!1
@RaghavPal
2 жыл бұрын
Glad I could help Cristian
@artemkot7864
4 жыл бұрын
This is an awesome video! I'm very grateful. Especially for brief overview on the practice of OOP test structure
@RaghavPal
4 жыл бұрын
Glad it was helpful Артём
@elmariscal5394
Жыл бұрын
Hi Raghav , thanks for sharing . In my opinion I would prefer : visibility_of_element_located rather than presence_of_element_located coz I first wait for the visibility of the object and then yes I interact with that element.
@RaghavPal
Жыл бұрын
ok, sure can go with what is best for your needs and project requirements El
@durga8157
2 жыл бұрын
Yes Sir, it is really helpful. Thank you very much 😊
@RaghavPal
2 жыл бұрын
Most welcome
@marcoosuna6623
2 жыл бұрын
Great video, much appreciated. Best I have seen regarding POM.
@RaghavPal
2 жыл бұрын
Hi Marco, thanks a lot for your kind words
@nandishajani
4 жыл бұрын
I have one general question regarding writing test cases. Suppose if we are testing a form and if it has 2 inputs (login and password) then should we write all the test cases for it? 1) Valid Login name, Valid Password 2) Valid login name, Invalid Password 3) Invalid Login name, Valid Password 4) Invalid Login name, Invalid Password
@RaghavPal
4 жыл бұрын
Hi Nandish, yes you can cover all possible scenarios. A data driven test will be better here where you can get the data drom a external file like excel
@nandishajani
4 жыл бұрын
@@RaghavPal thanks. But suppose if there are 16 input items in the form then i think there will be thousands of test cases if we follow the same approach.. So how to write test cases in that scenario?
@RaghavPal
4 жыл бұрын
Sorry for late reply Nandish, I believe the test is same and the data varies, In that case data-driven test OR getting data from an external file is the best option.
@luisemilioogando
Жыл бұрын
Amazing quality, eventhough is old version of selenium if you know how to set up new on this will give you a complete Idea how to work with each topic, If you a have some projects we can practice this topic please let me know.
@RaghavPal
Жыл бұрын
Sure, will check on that
@abdeljalildrissi
2 жыл бұрын
Many thanks it was very clear and well explained 👌
@RaghavPal
2 жыл бұрын
Thanks a lot
@RajaSekar-vz5ln
2 жыл бұрын
Good presentation very good luck
@RaghavPal
2 жыл бұрын
Thanks Raja
@andresgarciafalcon2755
7 ай бұрын
Excellent tutorial!!! Thank you very much!!!
@RaghavPal
7 ай бұрын
Most welcome Andres
@mimahmed95
3 жыл бұрын
Excellent. Kudos For your Hardwork Man...
@RaghavPal
3 жыл бұрын
Thanks Ahmed
@nupurdeore
5 жыл бұрын
You are very good in teaching and this is awesome video..Thank you.
@RaghavPal
5 жыл бұрын
You're welcome Nupur
@raokblee2157
5 жыл бұрын
Nice job Raghav! My Python POM is alive!
@RaghavPal
5 жыл бұрын
Glad to know this Boten
@krunalmehta2135
5 жыл бұрын
Very good video, thanks for creating such material.
@RaghavPal
5 жыл бұрын
You're welcome Krunal
@sayari_sachanji
6 жыл бұрын
nice 1, waiting for the video of reading test input like username, password from the CSV file.
@RaghavPal
6 жыл бұрын
will do i† soon
@sayari_sachanji
6 жыл бұрын
Automation Step by Step - Raghav Pal thank you so much :)
@nagamurali708
3 жыл бұрын
Thank You Raghav it's Informative
@RaghavPal
3 жыл бұрын
Thanks and welcome Naga
@giladhershcovitz1849
4 жыл бұрын
Solution for error message on running the invalid test on 53:00 : Needed to give parameters as so : message = driver.find_element_by_xpath(login.invalidUserName_msg_xpath).text instead of : message = driver.find_element_by_xpath("").text In the login.py file :P
@RaghavPal
4 жыл бұрын
Thanks for adding Gilad
@giladhershcovitz1849
4 жыл бұрын
@@RaghavPal Thanks for making awesome content!
@tapaskhandai
Жыл бұрын
Great tutorial. Completely understood. The only thing is that ,for me in loginpage, homepage class if i do self.driver. ,then no option for find elements was showing, i have done it manually and its working fine. This is strange.
@RaghavPal
Жыл бұрын
Hi Tapas, you might have imported the class with all properties
@ahmed199027
6 жыл бұрын
Thanks a lot bro, Your videos are always Excellent. Please make videos on Serverless AWS.
@Jele-f2c
2 ай бұрын
Hi there, I had a question. In what scenarios will running the tests from command line be helpful ? Doing that seems like more work when we can just run it from the IDE 😅
@RaghavPal
Ай бұрын
Jele Let's break down the scenarios where running Selenium tests from the command line can be helpful: I am added all details. it can be long but i hope will help everyone in future... Scenario 1: Automation and CI/CD Pipelines When you're working on a large project, you might want to automate the testing process as part of your Continuous Integration and Continuous Deployment (CI/CD) pipeline. Running tests from the command line allows you to integrate your tests with tools like Jenkins, Travis CI, CircleCI, or GitHub Actions. This way, your tests can run automatically whenever code changes are pushed to your repository, ensuring that your code is tested thoroughly before deployment. Scenario 2: Multi-Environment Testing Imagine you need to test your application on different environments, such as different browsers, operating systems, or mobile devices. Running tests from the command line allows you to easily switch between environments by modifying the command-line arguments or environment variables. This can be more efficient than constantly changing settings within your IDE. Scenario 3: Distributed Testing When you have a large test suite, running tests in parallel can significantly reduce the overall testing time. Command-line execution enables you to distribute your tests across multiple machines or containers, making it easier to scale your testing efforts. Scenario 4: Headless Testing Sometimes, you might want to run your tests in a headless mode, without displaying the browser UI. Command-line execution makes it easy to run tests in headless mode, which can be useful for testing in environments where a display is not available or when you want to reduce the resource usage. Scenario 5: Scheduled Testing You might want to schedule your tests to run at specific times or intervals, such as nightly or weekly. Command-line execution allows you to use tools like cron jobs (on Linux/macOS) or Task Scheduler (on Windows) to automate the testing process. Scenario 6: Remote Testing When working in a team, you might want to run tests on a remote machine or a cloud-based infrastructure. Command-line execution enables you to run tests remotely, making it easier to collaborate with team members or use cloud-based testing services. Scenario 7: Debugging and Troubleshooting When debugging issues, running tests from the command line can provide more detailed output and error messages, making it easier to identify and troubleshoot problems. While it's true that running tests from the IDE can be more convenient, there are scenarios where running tests from the command line provides more flexibility, scalability, and automation capabilities -
@jaiminbhavsar7541
4 жыл бұрын
Awesome tutorial.... with very good explanation of POM concept :) Thank you.
@RaghavPal
4 жыл бұрын
Glad it was helpful Jaimin
@MyRocknRolll
4 жыл бұрын
Hello, Raghav! This video is very useful for me. I'm a newbie in Selenium, and here are my questions: 1) 50:59 - We should write "message = driver.find_element_by_xpath("//span[@id='spanMessage']").text" instead of "message = driver.find_element_by_xpath("").text". Am I right? 2) 50:31 - We don't call the function "check_invalid_username_message" anywhere. Is it ok? When should it be called?
@RaghavPal
4 жыл бұрын
1) Yes right 2) You can call it wherever you need in your test. In case you do not need do not call
@MrTomer157
4 жыл бұрын
Amazing tutorial Raghav . Thank you so much !
@RaghavPal
4 жыл бұрын
Most welcome Tomer
@viachaslaumosilevich170
5 жыл бұрын
Tnx, very good. The best teacher here !
@RaghavPal
5 жыл бұрын
Thanks a lot Viachaslau, humbled
@tfbarrett2004
5 жыл бұрын
Great video. Could you please add on to this video by showing how to implement Behave into a framework like this? Thank you!
@RaghavPal
5 жыл бұрын
Hi Tim, sure I will work on this in some time
@ChatGPTtest-tp3vi
3 ай бұрын
Hello Raghav Da, Thanks for this amazing tutorial. I could follow most of it without any problem but facing a bit of issue when calling the loginpage class in my logintest. So when ever I am creating an object of that class it is throwing error because of the parameters called. Its says the parameter is unrecognized. When looking for the suggestions I am getting the parameter as "driver=". I am not sure what should be the value of the driver, what should I put after equals sign.. when calling it in the test class, can you please help? Thank you so much. Binita
@RaghavPal
3 ай бұрын
Binita When working with the Page Object Model (POM) in Selenium Python, you need to pass the WebDriver instance (the browser driver) to your page classes. Let’s address this issue: 1. Passing WebDriver to Page Classes: - In POM, each page class should have a `WebDriver` object as a class member. This allows you to interact with web elements on that page. - You can pass the `WebDriver` instance as a parameter to the constructor of your page class. 2. Example Implementation: - Suppose you have a `LoginPage` class. Here's how you can pass the `driver` to it: ```python from selenium import webdriver class LoginPage: def __init__(self, driver): self.driver = driver # Other page elements and methods go here # Usage in your test class: driver = webdriver.Chrome() # Initialize your WebDriver (e.g., Chrome, Firefox, etc.) login_page = LoginPage(driver) # Create an instance of LoginPage ``` 3. Page Factory (Optional): - If you're using Page Factory (a part of POM), you can simplify this further: ```python from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC class LoginPage: def __init__(self, driver): self.driver = driver # Initialize page elements using @FindBy annotations # Usage in your test class: driver = webdriver.Chrome() login_page = LoginPage(driver) ``` Remember to adjust the class name (`LoginPage` in this example) to match your actual page class --
@kamalnathlp6814
5 жыл бұрын
Have Enjoyed your session and learned lot sir. There is small mistake in xpath that you didn't call the function "check_invalid_username_message ".
@RaghavPal
5 жыл бұрын
I will check Kamalnath. Thanks for watching
@siddhee18bugata15
4 жыл бұрын
Hi Raghav, I was facing issues in understanding the concept of POM in selenium Python, your tutorial above has cleared all my doubts and implementation of POM in selenium Python Raghav, thx a ton for helping us out with such useful videos on testing stack, Raghav, the above POM what ever has been explained in the video is without using Page Factory ryt?? correct me if i'm wrong.. Can u kindly explain the same above example and concept by also using page factory and POM as well in selenium python.. It would be really useful for us ... Thanks in Advance, Siddhee :)
@RaghavPal
4 жыл бұрын
Happy to know this Siddhee, will do a session on Page Factory too
@siddhee18bugata15
4 жыл бұрын
@@RaghavPal Thanks a ton Raghav :), will be waiting for your tutorial on Page factory model in selenium python, kindly do let me wen u upload it.. and also i have to admit whenever ppl have doubts/questions u always took that extra initiative in replying to each and everyone whoever has doubts and commented..that virtual help is much needed and thanx a ton again Raghavv :) Thanks in Advance, Siddhee :)
@robertsorbet5729
4 жыл бұрын
Everything's perfectly explained as usual. Only one question arises. How do I add another test to continue in the same browser window? I know how to initiate a new window, but how can I continue?
@RaghavPal
4 жыл бұрын
Hi Robert, you can do the following Start the session (browser) only once and do not close or quit at the end of first test, continue or call the next test case. Can check this - www.lambdatest.com/blog/pytest-tutorial-executing-multiple-test-cases-from-single-file/
@vishaltripathi1883
3 жыл бұрын
Hi Raghav, I see that you have used HtmlTestRunnerfor generating the reports but this does not seem to work with python 3.0+ is there any other alternative?
@RaghavPal
3 жыл бұрын
Hi Vishal, can check the ver that works with Python3, pypi.org/project/HTMLTestRunner-Python3/
@ArturSpirin
5 жыл бұрын
Every video I have watched teaches POM in a half baked manner. Its like info here is not wrong but its incomplete and thus steers people the wrong way because once they learn this - its hard to unlearn and do it right (that's assuming they even will continue try to improve their skills in page objects, most will just assume this is the only way).
@RaghavPal
5 жыл бұрын
Hi Artur, you can provide more details. It will help all
@jaiprakasharora748
4 жыл бұрын
Thanks for the wonderful Video. Very well explained.
@RaghavPal
4 жыл бұрын
You're welcome Jai
@wluna5946
4 жыл бұрын
Very good tutorial , any video how to create a web from basic by sampling
@RaghavPal
4 жыл бұрын
Hi Awaluddin, what exactly are you looking for, Can check the tutorials here - automationstepbystep.com/
@jyothi1988
2 жыл бұрын
great video.. helped me lot..
@RaghavPal
2 жыл бұрын
Glad to hear that Jyothi
@jyothi1988
2 жыл бұрын
@@RaghavPal thank you.. but can you suggest what we should do if we get flex objects.. I have searched a lot, but no use.. please guide me..
@RaghavPal
2 жыл бұрын
I will check on this
@jyothi1988
2 жыл бұрын
@@RaghavPalthanks a lot..
@kiranattal5782
4 жыл бұрын
worth my time... genuine solid content
@RaghavPal
4 жыл бұрын
Happy to know this Kiran
@sanjitroy1992
4 жыл бұрын
Thanks a lot Raghav, this content is gold. :)
@RaghavPal
4 жыл бұрын
Thanks a lot Sanjit, humbled.
@abhishake24
11 ай бұрын
Great video as always Raghav, however I had a question, how do you test multiple UI (like buttons and creation of forms) in the site itself without logging out? do I have to write new tests scripts in which I have to login once again everytime? or is there a better way?
@RaghavPal
11 ай бұрын
Abhishek There are a few ways to test multiple UI elements on a website without logging out in Selenium Python. *1. Use a test framework that supports fixtures.* Fixtures are reusable objects or data that can be shared between test cases. For example, you could create a fixture that logs in to the website, and then use that fixture in all of your test cases. *2. Use a page object model.* A page object model is a design pattern that helps you to organize your test code and make it more reusable. You can create a page object for each page on your website, and then use those page objects in your test cases. *3. Use a test runner that supports data-driven testing.* Data-driven testing allows you to run the same test case with different data sets. This can be useful for testing different combinations of UI elements. Here is an example of how to use a fixture to test multiple UI elements on a website without logging out: ```python import unittest from selenium import webdriver class TestLogin(unittest.TestCase): @classmethod def setUpClass(cls): cls.driver = webdriver.Chrome() cls.driver.get("example.com/login") # Login to the website cls.driver.find_element_by_id("username").send_keys("username") cls.driver.find_element_by_id("password").send_keys("password") cls.driver.find_element_by_id("login").click() @classmethod def tearDownClass(cls): cls.driver.quit() def test_button_click(self): # Click on a button on the website self.driver.find_element_by_id("button").click() # Verify that the button click was successful self.assertEqual(self.driver.current_url, "example.com/success") def test_form_creation(self): # Create a new form on the website self.driver.find_element_by_id("name").send_keys("John Doe") self.driver.find_element_by_id("email").send_keys("john.doe@example.com") self.driver.find_element_by_id("submit").click() # Verify that the form creation was successful self.assertEqual(self.driver.current_url, "example.com/success") if __name__ == "__main__": unittest.main() ``` This test case will login to the website using the fixture in the `setUpClass()` method. Then, it will click on a button and verify that the button click was successful. Finally, it will create a new form and verify that the form creation was successful. You can use this same approach to test multiple UI elements on a website without logging out. Simply create a new test case for each UI element you want to test, and use the fixture in the `setUpClass()` method to login to the website. I hope this helps
@abhishake24
11 ай бұрын
@@RaghavPal yes sir this is very helpful but I have another question, when I save the test results of this code for example, to an html how can each test be validated and shown as passed with a message?
@RaghavPal
11 ай бұрын
not very sure, will need to check online
@locnguyen2306
5 жыл бұрын
Thank you bro! It's such an awesome lesson to me.
@RaghavPal
5 жыл бұрын
Glad to know this.
@ind24anjani80
4 жыл бұрын
wonderful video, thankyou veryyy much
@RaghavPal
4 жыл бұрын
You're welcome
@ramalakshmi5640
3 жыл бұрын
Must worth to watch 👍
@RaghavPal
3 жыл бұрын
Thanks Rama
@tavogudino8150
3 жыл бұрын
How can I solve this error? TypeError: LoginPage () takes no arguments at login = LoginPage (driver)
@RaghavPal
3 жыл бұрын
Hi Tavo, pls check your LoginPage class and its constructor. Most probably, you have not taken any arguments in the constructor
@PardeepKumarbindass
4 жыл бұрын
Excellent Tutorial Raghav, Could you please tell me why we use constructor here?
@RaghavPal
4 жыл бұрын
Hi Pradeep, constructor is called whenever we create a object of the class. We make use of this property to force user to provide some parameters while creating objects
@photodoor913
5 жыл бұрын
Thank you so much for this tutorial! I was having a hard time understanding the basics in getting this started, but you explained it very well. Is there any way at some point you can show how to select drop downs with Page Object Model and using dynamic data? Thanks again!
@RaghavPal
5 жыл бұрын
Glad to know that Mike, I will add more videos. You can also get the complete course here - www.udemy.com/selenium-python-step-by-step-for-beginners/ Use coupon - DISCOUNT_UDEMY
@archiplayhouse
4 жыл бұрын
Hello sir, Could you please make a video on selecting dependant drop down values in an array which is for example if you select one drop down value then another drop down should appear in the UI so that I can select the next drop down value. Currently I am facing problem in automating this in python
@RaghavPal
4 жыл бұрын
Hi Prabhu, I will plan to have a session on this, In case you have some demo website, can send me the link
@azharuddinkhan2317
6 жыл бұрын
As Always ... The Best
@RaghavPal
6 жыл бұрын
Thanks a lot Azhar
@srinivasav2440
3 жыл бұрын
how to open the orangehrm site with english text, it is opening for me in chines language?
@RaghavPal
3 жыл бұрын
Hi Srinivasa, its from the backend, you can use these to practice opensource-demo.orangehrmlive.com/ trytestingthis.netlify.app/
@rkn3383
5 жыл бұрын
Excellent
@RaghavPal
5 жыл бұрын
Thanks RK
@nehadubey221
5 жыл бұрын
This is a great tutorial, helped me to build a framework on my own. Thank you. I do have a question. How do I read text on a button on a page? I tried using find_element_by_name but it don't work.
@iDriveXUV
5 жыл бұрын
Use this.. Element = driver.find_element_by_id("some name") Print(Element.text) Hope dis will help you...
@RaghavPal
5 жыл бұрын
Thanks for your inputs Satheesh. Neha, hope this is useful
@nehadubey221
5 жыл бұрын
Satheesh Kumar Thankyou for your help. In my case there was no id on the button so I finally used the combination of name and value as it is unique and it worked.
@nehadubey221
5 жыл бұрын
@@RaghavPal @Satish I got the other issue working however now I am facing another big issue. How do I check for the existence of a modal/dialog. It is not an alert so I cannot use switch_to alert method. The html element I am speaking of has following arguments: role=dialog aria-labelledby=label aria-describedby=description. Any hints wold be highly appreciated. Thank you.
@RaghavPal
5 жыл бұрын
Hi Neha, is this site accessible publicly? You can check this stackoverflow.com/questions/19003003/check-if-any-alert-exists-using-selenium-with-python huddle.eurostarsoftwaretesting.com/selenium-interact-modal-windows/sqa.stackexchange.com/questions/26130/java-selenium-check-if-modal-popup-present
@akshatvohra6
4 жыл бұрын
Raghav, can you please make a video on how to explain our framework with respect to OOPS concepts.
@RaghavPal
4 жыл бұрын
Sure Akshat, you may find some tutorials on programming and OOPs here - automationstepbystep.com/
@JainmiahSk
2 жыл бұрын
Very nice video. what is the use of unittest here if I don't use unittest can't I use selenium with classes? in production unittest should be used ? please clarify my doubts thank you.
@RaghavPal
2 жыл бұрын
Hi, you can use any testing framework as per your needs
@krishnakishore6180
4 жыл бұрын
Hi Raghav I bought your Selenium Python course in Udemy , appriciate your explanation and also i want to request you add the topics like handling calenders, alerts, Javascrip objects and mainly End to End BDD framework which is in high demand . Please help us in updating the topics
@RaghavPal
4 жыл бұрын
I will work on this Krishna
@krishnakishore6180
4 жыл бұрын
@@RaghavPal will be really great help Raghav. Also please let me know if you are planning to update Devops videos i will be purchasing them i am in much needed topics like Ansible, Terraform etc and other devops topics.
@RaghavPal
4 жыл бұрын
Hi Krishna, I am in process of developing these courses. As of now Kubernetes is in progress will do others in sequence.
@aliozyer5487
5 жыл бұрын
da best teacher ever
@RaghavPal
5 жыл бұрын
Honored & Humbled to read this Ali. Thanks
@amareshawati1563
5 жыл бұрын
Hi Raghav, Thank you very much for your tutorial. I want to capture screenshot when the test case fails and i want to add same screenshot to the html report. Is this possible in selenium-python? if yes, please help me how can I do that.
@amareshawati1563
5 жыл бұрын
Hi Raghav, Any luck on this?
@RaghavPal
5 жыл бұрын
Hi Amaresh, you can use PyTest. This will help - www.automationtesting.co.in/2017/02/pytest-with-selenium-html-report-with.html?m4dc=1 stackoverflow.com/questions/50534623/how-do-i-include-screenshot-in-python-pytest-html-report
@ukasz8631
Жыл бұрын
i can somehow call out method from another file but the code isn't running saying that it doesn't find the module despite the fact that I've changed directory of module package either by import sys ... edit enviroment in windowds or run launch.json and settings.json. I'm kinda hopeless at this point. I rly want to finish this project but i cannot go past this problem in VS code.
@RaghavPal
Жыл бұрын
Hi Łukasz, pls check this github.com/microsoft/vscode/issues/10391
@logashanmugam5947
2 жыл бұрын
I have a small question. Around @11:39 in the video you have used find by link text. Now if I have multiple links of same text (like a click here text but at multiple places in a same page table), but dont have any identifier like id or class is there anyway to access one particular link?
@RaghavPal
2 жыл бұрын
Hi Loga, in that case you can use index value
@Canda-fh4xc
5 жыл бұрын
Thank you for this great tutorial. Do you have any tutorial about Appium?
@RaghavPal
5 жыл бұрын
Hi Sam, thanks for watching Appium will be coming soon
@saikrishna3032
2 ай бұрын
love this video💖💖
@RaghavPal
2 ай бұрын
Thank you Sai
@saikrishna3032
2 ай бұрын
@@RaghavPal 😍
@swetamallick6282
3 жыл бұрын
This video is so lucid. Thank you! one doubt- reports are not generating for me. I am running script from IDE. Is it necessary to execute script using command prompt in order to get the report generated? Please answer.
@RaghavPal
3 жыл бұрын
Hi Sweta, thanks for watching, there are some reporting lib that work from cmd line I must have shown some examples may be in later videos on how to generate reports from IDE
@swetamallick6282
3 жыл бұрын
@@RaghavPal thanks a lot, Raghav. I generated default report from the console. That also helped me. 😊
@jybetton838
2 жыл бұрын
Hello Raghav, thank you for this video, it's the best I've come across on the topic. I've followed your video and keep getting the "ModuleNotFoundError" when I try and run the tests :( I have the tests and page objects in different folders and import the page objects class into the tests, I've also looked online for a solution, tried all I could. Still getting that error. Could you advise please? Many thanks!
@RaghavPal
2 жыл бұрын
Hi, I have shown the solution in this video from kzitem.info/news/bejne/o4uIsWuthpV0qoo.
@sabertrimech447
4 жыл бұрын
Hi , I see a lot of people have blocked on unresloved error problem for import: ImportError: No module named SampleProjectPOM.POMDemo.Pages.LoginPage but it seems that there is no solution posted yet :( could some one help ? (for info, even when marked the floder as sources ROOT it doesn't work) thank you in advance :)
@RaghavPal
4 жыл бұрын
Hi Saber, I have shown the solution in this video from kzitem.info/news/bejne/o4uIsWuthpV0qoo. Please check. Start your command with python -m pytest Please check this:stackoverflow.com/questions/10253826/path-issue-with-pytest-importerror-no-module-named-yadayadayadagithub.com/pytest-dev/pytest/issues/2287
@jacoby8934
4 жыл бұрын
Great video Raghav. as always! I have a few questions regarding POM. Why there was no homepage under Tests folder as well? you did some testing there as well like clicking on some buttons. What are the rules regarding POM tests folder? if under pages you add new python file(and class) for each new page, should be for tabs as well? in your case there was a login test. should there be also the actions you plan to do in the website (click on tabs, links, choose dates etc...). Thanks alot again.
@RaghavPal
4 жыл бұрын
Hi Jacob, in POM, we create objects per page and store them in separate files/classes. So you can see page for loginpage and homepage objects. While creating a test, it can be a use-case that starts from loginpage and can go to multiple pages after login. So there we do not have concept of creating tests page wise.
@manjunathhunashikatti2134
3 жыл бұрын
The Best !!! , Clear and straightForward Explaination Thank you , can you suggest any Python module I can use for Desktop application UI automation Testing???
@RaghavPal
3 жыл бұрын
Hi Manjunath, you can try Robot Framework libraries
@manjunathhunashikatti2134
3 жыл бұрын
@@RaghavPal iam using pywinauto currently and eventually will integrate with robot framework but is there any specific other libraries than pywinauto?
@RaghavPal
3 жыл бұрын
This should be fine, You can search in case you have any more needs
@darshanmm9
6 жыл бұрын
Excellent video Raghav, can you please increase your editor font size so we can read it more easily on mobile screen also?😊
@RaghavPal
6 жыл бұрын
Thanks for watching Darshan, sure I will do that.
@rajeshraju2674
4 жыл бұрын
@ 50.46 mins, you created a function Check)invalid_username_message(self) with a variable msg and returned it. Where in the test are you using it ?
@RaghavPal
4 жыл бұрын
Hi Rajesh, if you see after this, I have called this in the login.py method test_login_invalid_username()
@rajeshraju2674
4 жыл бұрын
@@RaghavPal I went through the video but could not find the refernce to it the test_login_invalid_username() , I see the variable "message" is used in here , did you mean "msg" and "message" are the same and could have been a typo error ?
@RaghavPal
4 жыл бұрын
Hi Rajesh, I will check again, But in general, it was demoed that you create all locators and functions in the page class and then call the methods in the test class and use it. As long as you have got the concept, it should be fine
@shilpathomas2302
4 жыл бұрын
Hi Raghav, Thank you so much for the tutorial.But when I try to import HTMltest runner in pycharm which is already installed via cmd, shows not installed and when I try to install the package in Pycharm, getting following error. Collecting HtmlTestRunner Could not find a version that satisfies the requirement HtmlTestRunner (from versions: ) No matching distribution found for HtmlTestRunner Please help.
@RaghavPal
4 жыл бұрын
Hi Shilpa, can you check the documentation for HTML runner and see the supported python versions.
@vspvzm3258
2 жыл бұрын
hi Raghav had a query , can we able to add all locators in a different file under the project and able to import to the current file? rather than giving locators straight away as pointed in the above video?
@RaghavPal
2 жыл бұрын
Hi, yes, that's how we do Page Object Model, you may find it in some of my videos automationstepbystep.com/
@Lilyrockstarr
2 жыл бұрын
there is no function self.browser.find_element_by_id in Python 4 and there's self.browser.find_element(By.ID, "btnLogin") instead. How should I change self.browser.find_element_by_id(self.username_textbox_id)?
@RaghavPal
2 жыл бұрын
HI Lilia, I will check for Python 4 and add new sessions, For now, if you need to use Python 4, check the latest Selenium Python 4 documentation www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/
@Lilyrockstarr
2 жыл бұрын
@@RaghavPal thank you so much. Do you have GitHub with all the lesson’s codes by any chance?
@RaghavPal
2 жыл бұрын
Can check there Lilia - automationstepbystep.com/
@vspvzm3258
2 жыл бұрын
is tab spacing not required as we discussed in one of the previous sessions? can you please clarify
@RaghavPal
2 жыл бұрын
Hi, it will be needed
@jeffreyphillips334
2 жыл бұрын
Do you have an example of how get the size of Table and dynamically create a path.
@RaghavPal
2 жыл бұрын
Hi Jeffrey, not as of now
@PREC0GNITAVE
4 жыл бұрын
Thanks for this video. I was wondering if you could do a tutorial on deployment of a framework like this to a server or VM? For example if I created a project like this in Pycharm or whatever IDE and then wanted it running on a server via command line?
@RaghavPal
4 жыл бұрын
Hi, sure, I will plan a session on this
@PREC0GNITAVE
4 жыл бұрын
@@RaghavPal Oh that would be most appreciated thank you!
@feiomaskatista
5 жыл бұрын
What if I create like in Java a "base_class.py" with the selenium driver instance and the set up methods in it? I got this question because the way you're teaching, we will need to code in every test class driver = webdriver... driver.implicity.... and I have learned that when we are repeating code, there is something not planned. What is your point?
@RaghavPal
5 жыл бұрын
Hi Danilo, yes you can create a base class where web driver is instantiated, i will cover this in some future video.
@feiomaskatista
5 жыл бұрын
@@RaghavPal Cool! Great videos by the way!!!
@sivalingamarumugam3583
4 жыл бұрын
im getting below error File "C:\Users\arumugam001\PycharmProjects\SeleniumDemo\RW\Test\login.py", line 21, in test_login driver = self.driver AttributeError: 'LoginTest' object has no attribute 'driver'
@RaghavPal
4 жыл бұрын
Hi Siva, pls check again, you may be missing some import
@dhanashriaherkar2605
4 жыл бұрын
Hi Raghav, I have covered all the 17 videos of selenium python. Its really useful. Do you have further session of same? like advance coding?
@RaghavPal
4 жыл бұрын
Hi Dhanashri, There is a course with complete framework development step by step on my Udemy channel - automationstepbystep.com/udemy-discounts/
@BhupendraSadayeHORNOKPLZ
4 жыл бұрын
Getting issue in HtmlTestRunner PFB error I tried upgrading my python to latest version after this error still didn't solve for me could any one please help. "Could not find a version that satisfies the requirement HtmltestRunner (from versions: none)"
@RaghavPal
4 жыл бұрын
Hi Bhupendra, could not find any specific solution online. In the documentation page - pypi.org/project/html-testRunner/ it says can work with Python 3.5
@neelambikalearnfun4041
4 жыл бұрын
Hi Ragav. I have 1 queries. Curently I am using pyautogui for screenshot. It's taking screenshot for the browser window where the script is running. But while execution if I minimise the browser window and open any other application then execution still run but it capture the other app window as screenshot Can you suggest how I can take the screenshot even if I minimise the browser. I mean if execution run in background in that case how to take that screenshot
@RaghavPal
4 жыл бұрын
Hi Neelambika, you may try some other libraries for screenshots. Check this pythonbasics.org/selenium-screenshot/ www.geeksforgeeks.org/how-to-take-screenshot-using-selenium-in-python/ stackoverflow.com/questions/41721734/take-screenshot-of-full-page-with-selenium-python-with-chromedriver
@yelsinsepulveda5291
3 жыл бұрын
Awesome video, very helpful. Might someone know how I can get the description if each test in the generated report? I'm trying 'descriptions=True' but no luck.
@RaghavPal
3 жыл бұрын
Hi Yelsin, hope you have added descriptions in the test case, will need to check more on this
Пікірлер: 665