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

Take This Entire Course for Free

What will you learn in this lecture?

In this video, we will go through the process on how to use C# to find a value in a cell of the Elements Identification course.

Selenium Tutorial – How to Use C# to Find a Value in a Cell 2


So now we’re in our next. Well let’s step through this and you’re going to step over that this well. With the text war that one is irrelevant to us as well right. We don’t care about the work because the text is not equal to what we want here. So let’s step over this step over that step over that column counter increases again. And now we own column number three. That’s what we should be called number three which makes sense right. We’re right here. And so if I step over this you guys can see that cell that x is equal to salary. Fantastic. So if it’s equal to salary then what do we do we increase.

We store the column index column index route now rather than being minus 1 is going to be the column that we want which is number three and you guys see the beauty of this right. Because if this salary column moved over to here number two or we added another column and we put salary in there then it would still not matter. This logic will still work because we would still go through the roll sell buy sell buy sell buy sell storing the on index and then based on data we would dynamically figure out where we need to go. That’s why this logic is so cool anyway. So we step through that. So that tax is not going to equal our desired value because we’re right here. So we’re going to step over this and move through this loop is finished.

And we only had three cells in that row and now we move on to the next one. We increase the counter so from zero we increase it to 1. And now we are at is equal to 1 which is here are equal to 1 which is this one right. So let’s step through that. We’re looking at this guy and same thing is going to happen here. Now we’re going to step through sell buy sell buy sell and if the text matches this guy then we’re going to process it. So let’s go through because it will match on the first iteration for every cell in all our cell rolls if the cell matches the column header which you want because that will only happen one time only for the column headers.

Now we’re checking if it has our desired value which is software development engineer and test which had does. And so now what we’re trying to get to is this right here. Right. So let me actually we’re here let’s get to there so we wanted the body we wanted to. And after T are two we want table data. Right. With which table data do we want number three right. This guy and this number three corresponds to this column right here the salary column. That’s why it’s number three all of these TVs in here are going to be 3s. 3 3 3. And so what we do here is we create this cool string that is going to allow us. So check it out. We want this guy right. So it’s going to allow us to create this dynamic string using the same exact XPath expression.

But instead our table roll we’re going to replace with the table roll count plus 1. Because I remember in C-sharp our collection starts at zero. However in XPath our table collection starts with 1. This is one that has two but right now we’re TR 1. So we need to make it two so that it’s equivalent to this value. And then we need to go one child below to the table data and make it number three which is just going to be the column in that X that we were tracking right here. Whenever we got the salary value we also got the column index. We thought it had its index number three.

And so now we’re using it to dynamically generate this salary locator. And so when I step over it check it out our salary locator matches the exact expression that we have right here. You guys see how awesome that is. So we were dynamically able to get this column and this row. And based on that right this intersection. So this column and this row gets us this intersection let me see if I can actually represent that with some X path.

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

Share This