1

<span class="title ng-binding">TEST</span>

ı want to click the following. I ve tried lots of ways but did not success. Thanks for your helping.

3
  • Which Selenium Language Binding Art are you using? Java / Python / C# / NodeJS ? Commented Dec 3, 2018 at 10:39
  • I use Java @DebanjanB. Actually there is a left side bar menu which made by Angular and i want to click a page inside the menu. Commented Dec 4, 2018 at 4:48
  • when i try the "new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("span.title.ng-binding"))).click(); " the action is just opening the menu. ı can not click the page. Commented Dec 4, 2018 at 4:49

1 Answer 1

1

The desired element is an Angular element so you have to induce WebDriverwait for the desired element to be clickable and you can use either of the following (Java) solutions:

  • cssSelector:

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("span.title.ng-binding"))).click();  
    
  • xpath:

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//span[@class='title ng-binding' and contains(.,'TEST')]"))).click();
    
Sign up to request clarification or add additional context in comments.

2 Comments

@MuhammetAltunbaş To comment or ask a counter question with respect to my Answer you must ask through a comment below my Answer only, else I don't get notified.
@MuhammetAltunbaş If your requirement have changed feel free to raise a new question. Stackoverflow volunteers will be happy to help you out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.