Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

//input[starts-with(@id,'')]

//a[contains(@href,'certification')]/parent::li/following-sibling::li/a

-----------------------------
handling static webtable

1. Step : get the Iwebelement of the the table


IWebelement table =>driver.findElement(By.Xpath("//table[@id='resultTable']"))

2. Step 2 : Get all the rows

//List<IWebElement>
allRows=>driver.findElements("//table[@id='resultTable']/tbody/tr");
List<IWebElement> allRows=>table.findElements(By.Tagname("tr"));

3. Loop through each row

foreach(IWebelement row in allRows)


{
// printing by rows
//Console.WriteLine(row.text());
List<IWebelement> cells= row.FindElements(By.TagName("td"));
foreach(IWebelement cell in cells)
{
Console.WriteLine(cell.Text());
}
}

-----------------------------------------------------------------------------------
------
Table - Practice

You might also like