ashish kolhe
ashish kolhe

Reputation: 3

Geckodriver - unable to click the element

i am trying to automate logout functionality for - https://opensource-demo.orangehrmlive.com/ I could log out using chrome and edge but firefox is not clicking the element and selecting logout.

new WebDriverWait(cdriver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@id="welcome"]"))).click();

new WebDriverWait(cdriver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[contains(text(),"Logout")]"))).click();

Upvotes: 0

Views: 152

Answers (1)

Ketan Pardeshi
Ketan Pardeshi

Reputation: 792

Try using linktext

new WebDriverWait(cdriver, 20).until(ExpectedConditions.elementToBeClickable(By.linkText("Logout"))).click();

If it is still not working try clikcking using javascript

Upvotes: 0

Related Questions