What will you learn in this course?
Are you struggling with working with HTML using Selenium WebDriver? Do you know how to easily identify and manipulate an element using Selenium WebDriver? How about performing a drag n’ drop on an element? If not, then these are just a few of the questions that will be answered in this course.
This course is a complete guide on working with web elements in Selenium WebDriver! Once you are finished with this course, you will know how to work with any web elements, anytime, on any web application.
In this course from Ultimate QA, you will learn:
– Basics of HTML
– All the different locator strategies for Selenium WebDriver
– How to identify web elements using Selenium WebDriver
– Master XPath
– Navigation with Selenium WebDriver
– Web element manipulation
– Web element interrogation
– Mouse and keyboard actions with Selenium WebDriver
– Performing actions such as drag n’ drop, drawing, hovering
– Implicit and Explicit waits
– How to properly handle element identification so that your tests are not flaky
– Expected Conditions in Selenium WebDriver
What will you learn in this lecture?
In this video, we will go through the process of setting up local tests to start running in parallel of the Fast Tests Execution course.
Selenium Tutorial – Fast Tests Execution – Setting up local tests to start running in parallel
So one quick word of caution here is that unfortunately at this current time and unit cannot run test methods within a class in parallel multiple test methods. So what you have to do is actually put each of the test methods in their own class and only then they can be run in parallel. So let’s see here how we have you know one class and then a bunch of test methods which is basically our tests. We can’t do that with the end unit version 3.2 or whatever version I’m using right now. You can’t do that so therefore you have to create a single class for every single test.
So that’s actually exactly what I’m going to do. I’m going to take this I’m going to copy it. I’m going to paste it. So now we have this one copy. Double click on it so that you select it. And I’m going to rename this local tests to avi so I want that to match up with my file name so I’m going to come in here and do the same thing page that local test too. And so now a local test went on local test too.
I’m actually just going to remove this test method from here so that it doesn’t run to test this is actually going to be one test. And so we have local tests to mokel test 0 2 method. And then this one I’m also going to remove that second test because we no longer need it nor can we run it in parallel. And so now we have one test here and a second test here.
Now in order to make them run in parallel all you have to do is add a pair realizable attributes here. So they’re liable for the Test class. And so now I added it above local test or two. And I am going to local test one and then I’m going to add that here as well. So now both of our tests in theory are parallelizable as in they can run in parallel. So I’m going to go ahead and build here so that if they’re found in my test explore give it a second to build it succeeded.
So now I’m going to look in here and we have test 1 and test two. So now what I’m going to do is I’m going to press run ball and both of the tests should run at the same time. Let’s take a look. Very exciting. Here’s one Test starting to get executed. And here’s another test. But I don’t think those in parallel. I actually think that was sequentially and I don’t know if that’s because the tests are too fast for the other one to start or before the first one down and to start before the first one finishes or because I did something wrong.
Now let me take a look at local test one. I’m actually going to make it longer. So we’re going to do this again. We’re going to go to a different Yoro and another one of my blogs. And Dan let’s do a thread. Does sleep. Sometimes just until science is so annoying. Here in system threading that sleep time out in milliseconds. So let’s say 3000 milliseconds three seconds hopefully that’s enough time.
So now let’s do the same thing again if six to build it succeeds. Let’s go in our test explore to pass tests to. Let’s go ahead and try this again and do a run all. And now hopefully the first test is slow enough for the second test to start up. And here’s the first test. Pull that up. Boom there’s a second test. And you can see that the first test is still running and the second test is over here. Boom there it is. And this test just passed so you could you saw that right. How the first test was still running still going to the you all awry while the second test started running as well. So it just takes a little bit of time for Firefox driver to get up and running. While the first test was executing So congratulations we’ve just successfully executed parallel tests locally on our VM.