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 all cells in a row of the Elements Identification course.

Selenium Tutorial – How to Use C# to Find All Cells in a Row


Oh by the way guys this is probably an amazing interview question where they check to see how you use logic to figure out a problem like that. Right. So make sure you learn and understand everything that’s going on here. So what we need to do is circle every single row in our collection of rows right. So for every single row we need to read every single cell and get its value. You guys see that and read it all and get adds value. Once we figure out that we have software development engineer in test value we need to know what that row.

And once we know this row and we know the header here we can use the hatter’s index which is this number three and a rose index to figure out where this value lives. And as we step through the code hopefully it will make more sense to you guys.

Let me. This is all actually good. So let’s take a look here at the code first and then we’ll step through it. So for every TR Right row in our collection of rows that count we’re going to do a normal loop we’re going to increment and we’re going to start we are at zero. And the very first thing we need to do is saddo row equal to collection of rows and then the index. So if we started 0 this row variable is going to become our first row. In this case it would be zero which would be the headers. So then as we circled to the next one this guy would become this rolls just so we know which row all we’re working on and we have that stored inside of a variable. OK. So when we get that single row that we’re going to work with for this loop iteration we need to get all of the cells in that row and to do that.

So let’s actually do that right now so if we’re looking at a row.

So if we get this first All right we are in the first iteration of the loop because see I put TR 1 here. Now we’re working with this row.

How do we get all of its titleholders. Well that’s simple.

So you do the dot.

And so now we found all of the table headers. But remember that the table headers only live in the first row in the second row we got table data that lives. So we need something better than this locator. Well what if we just did a star here. Would that work. Of course it would. It would select all of the it would select our first throw. And then after that whatever lives inside of that it doesn’t matter it can be a star. Take a look at the second row boom. You guys see that selects every single cell inside of that. So over here this is what our X path query does. In fact we don’t even need those dot here. And so this will get us all of the cells. Right now we have the row and inside of the row we have every single 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