Varun.S
Varun.S

Reputation: 39

Unable to Click on Edit Button , in WebTable

I am using xpath to click on edit button , but i dont know where the webtable starts so i can click on the webelement. Below is the link for WebTable.

http://demo.automationtesting.in/WebTable.html

Thanks in Advance.

Upvotes: 1

Views: 303

Answers (2)

NarendraR
NarendraR

Reputation: 7708

If you want some specific selection e.g. want to edit info of particular user Then you can use below xpath where you have to changes email address only it will click on the edit icon of that particular record .

//div[text()='[email protected]']/../following-sibling::div//div[@class='avddbl']/button[contains(@class,'btn')]

Upvotes: 1

Andrei
Andrei

Reputation: 5637

Try this:

// gets the first edit button
WebElement Edit_btn= driver.findElements(By.xpath("//div[@class = 'avddbl']/button")).get(0); 
Actions action = new Actions(driver).doubleClick(Edit_btn); 
action.build().perform();

Upvotes: 1

Related Questions