xpath select td class contains text
xpath=//td[@title='Main']/following-sibling::td[contains(text(), 'Show')]// 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());
}
Also in HTML:
- number input html
- ionic segment
- relier js a html
- how to align text beside image in html
- html video repeating
- title tag html
- html interview questions
- html enlace
- html onblur
- html table span 2 rows
- no allow copy html
- html disable drag image
- how to make a calculator website HTML
- how to play youtube videos in html
- javascript onclick alert are you sure
- game engine
- how to center align text in html
- jinja2 template import html with as
- onclick mailto inline
- create page html
- get selected text of html dropdown in javascript
- coronavirus
- bold html
- tooltip in html