Answers for "div contains text xpath selenium"

0

xpath element that contains text

"//h4/a[contains(text(),'SAP M')]"
Posted by: Guest on May-11-2021
0

xpath select td class contains text

xpath=//td[@title='Main']/following-sibling::td[contains(text(), 'Show')]
Posted by: Guest on April-17-2020
0

xpath select td class contains text

// Get the content or container    
WebElement content = driver.findElement(By.id("contentText"));

//Get the table of users
WebElement tblUsers = content.findElement(By.xpath(".//table/tbody/tr[2]/td/table/tbody/tr/td[1]/table"));

// Get the rows which change always as and when users are added
WebElement allUsers = tblUsers.findElements(By.xpath(".//tbody/tr"));

// Loop through each row of users table
for(WebElement user : allUsers) {

   // Get the username
   WebElement username = user.findElement(By.xpath(".//td/table/tbody/tr/td[1]/strong[2]"));
   System.out.println("Username: " + username.getText());
}
Posted by: Guest on April-17-2020

Code answers related to "div contains text xpath selenium"

Browse Popular Code Answers by Language