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


Sweet. So now that we have all the cells in a row right all the cells in a row a collection of cells in a single row. What do we need to do we need to look through them and check to see what is it that they contain so that we know what we can use. Right.

And if the text in the cell is equal to our desired column Haueter which in this case is a salary then we’re going to store that in the column index. Right. So it’s going to be either index 1 2 or 3 and we’re storing data in the column index. However if the cell text contains our desired value which is a software development engineer in enticed we find the salary locator get the salary and then write it out using the con.. All right. So I can see I talked a lot and you guys probably want me to start running through the code so we can better understand it. Not a problem. Let me go ahead and put a breakpoint right here and start debugging the sucker.

So again while it’s pulling up the browser. Just remember the point right. We got the table inside of the table we have the rows so we grabbed the collection of rows inside of the rows we have cells that live. So we just need to run through every single row and through every single cell and get the values that we want if the cell has a value of salary then we want to know where that column lives. If the role has a value of software development engineer and test then we want to use the column of the salary and the role of this tax to get this value. You guys hopefully I hope you get it. All right. So for every single row in our collection of rows right we have four.

So I’m going to step into this now our collection of roses for. But if I use TR Right it’s zero. You guys got that here. TR from zero to collection of those that count. So when I step into this what’s going to happen is now this row only represents the very first row and it’s going to keep changing right with every iteration. This row is going to be the one that we’re analyzing. So now that we have this row let’s get all of the cells in that role. And each of these rows has three cells one two three. Let’s check it out. All cells in a row. And we got one which isn’t right. Let me scroll back up at a period here.

I think that was why I think you did need the period up over this again. There you go. Now we got three. So that was my mistake. You need a period to get all of the cells in a row. OK. So now we have three right because in this were all very first one. And actually let me select that right one so that you guys know what we’re talking about here.

There you go this is the one we’re talking about right now. We have three cells. Fantastic. Now we need to go through every single cell and check them for their values. So for each cell in our collection Let’s step in this cell right now. If we look at it it’s going to be the very first one. Right. And that contains title. But what we care about is that the cell that text is equal to our desired column Haueter which in our case you want salary. Right. So sell that xt. Died that right now it’s title because we’re looking at this all right here is equal to our salary. And in this case it’s not. So the column index which is just another variable this column index will not be stored it’s negative 1 right now. So it’s going to throw us problems if you try to use it. So I’m going to step over this.

That’s not going to be the case. And now also if the cell text is equal to our desired value which is software development engineer and test we need to process it. But you guys can see that it’s not. So we’re not going to be processing it. So let’s step over this column counter increases column counters just the counter of the column that you are at. So we started with Juan because we were on the first call and now we’re going to go to the second column. And every time this looping Crimmins we’re going to increase it so we increase the column counter. And now we move on to the next cell.

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