I am unable to identify element. please find my below code.
WebElement editorFrame = dr.findElement(By.id("1536219451331-0-uiGrid-000L-cell"));
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.
Sign up to join this communityI am unable to identify element. please find my below code.
WebElement editorFrame = dr.findElement(By.id("1536219451331-0-uiGrid-000L-cell"));
As this looks like a web table please find the below logic. Please use xpath instead of id to locate element.
List<WebElement> rowList = driver.findElements(By.xpath("//tr"));
for(WebElement row : rowList)
{
List<WebElement> columnList = driver.findElements(By.xpath("//td"));
for(WebElement cell : columnList)
{
String text = cell.getText();
System.out.println(text);
}
}
This is a sample code snippet to iterate a webtable. The first for loop is for iterating the rows and second for loop is for iterating the cells in each row. Hope this will help you understand the logic.
You could use xPath to find the column using the text from the first column.
So something like this would work:
//tr[td[contains(text(),'Cash Deposit (including online)')]]/td[2]
That will look the cell in the second column, where the first column is equal to the relevant text.