What will you learn in this lecture?

In the previous video, we learned using Selenium webdriver for element identification. In this video, we’ll learn about Selenium IDE.

Selenium IDE for Object Identification

The reason that I’m showing you guys all of this is because, fortunately, Selenium does not have a nice way to identify elements unlike something like a QTP that has that nice little object spy. Selenium does not have that.

Therefore, what happens is you spend most of your time. Well, I shouldn’t say most of your time. You spent a good portion of your time trying to identify elements. If the elements are easy to identify and the developers did a good job in making your application testable, then that time is almost negligible.

However, if they did not do a good job of helping you to automate the application, then you’re going to spend a ton of time identifying web elements and although that sucks, it’s completely the opposite for something like a QTP right where you don’t spend a lot of time identifying elements because they have the nice objects spy but you spend a crap load of time coding because the VB Script is such a weak language.

So, if you want to do something like click a button then wait for it, you have to write a shit ton of lines of code in order to make that happen. So that’s kind of the trade-off. Maybe one day, Selenium will add a nice object identification tool.

But until then we use tools like Selenium IDE just to get a little bit familiar and FirePath and Firebug to help us identify.

And once we learn all the skills that I’m teaching guys in this course, you really won’t care whether you have an object identification tool or not. Because you guys are going to be machines at identifying elements.

So having this IDE tool is nice but the reason that you can’t always use it is because it doesn’t always work or it doesn’t always give you the most efficient identifier.

For example, let’s look at these two buttons over here. If you look at this one, Selenium first tells you to identify those button using this XPath which is actually pretty excellent.

However, the only reason it knows how to do that is because I gave these two buttons to different tasks so that you guys can differentiate.

But if you imagine that these are just like log buttons.

Right.

One login button is in like the upper right corner and another log in button is maybe in the bottom right corner of the application. And if they’re both called logging and they both do exactly the same thing, they’re just located at different spots in the HTML so we can actually do that by looking here.

This will give us kind of a name. This is not an absolute path but a partial path. Here is a relative one. So here is one that does a little bit better.

I’m going to copy this and put that in there and then I want to look at the XPath button to write again.

It does a good job in selecting that. But then if I come here and then select that, go to my Notepad++ and paste that, here you guys can see that this XPath is almost exactly the same except for this form number 2. And this is form number 1.

So what if the any of these buttons were to change, right? If one button moved to one location another moved to a different location.

This absolute XPath would no longer be good because this would not get you to the right object.

Therefore, you have to learn the proper way to identify the elements which would be in this case using something like this.

And in this case, Selenium IDE did a great job in showing you guys that but you should be able to pick that out on your own using the skills that I will teach you so that you will never run into the issues that I mentioned and other issues that we will talk about a little bit later.

Next Tutorial

In the next tutorial, we will learn how to use an ID to identify elements.

What will you learn in this course?

Are you struggling with working with HTML using Selenium WebDriver? Do you know how to easily identify an element using Selenium WebDrriver? Do you know how to manipulate that web element? Do you know how to perform 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, any time, on any web application.

“Relevant content that I will be able to apply to my automation tests *immediately*, a VERY effective presentation approach (evolving the same example and comparing/contrasting), and an excellent teacher / presenter. Thank you so much for your time and sharing your knowledge Nikolay!.” 

-Krissy

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

Take This Entire Course for Free

Nikolay Advolodkin is a self-driven SDET on a lifelong mission to create profound change in the IT world and ultimately leave a legacy for his loved ones, community, and the world at large. Today, he serves as the CEO and Test Automation Instructor at UltimateQA.com and contributes informative articles to leading test automaton websites like SimpleProgrammer.com and TechBeacon.com

Pin It on Pinterest

Shares
Share This