Unable to click on 'sign out' link



  • enter image description here

    I am trying to click on sign out link, but not able to succeed: I tried the below ways,

    Click Element    class=mat-icon.notranslate.mat-primary.material-icons
    Click Button     name=Sign Out
    Click Element    name=Sign Out
    


  • Selenium probably is not working properly against this Angular custom element. You can try to execute Javascript to perform the clicking.

    JavascriptExecutor js = (JavascriptExecutor)driver;
    WebElement button = driver.findElement(By.cssSelector(".mat-icon"));
    js.executeScript("argument[0].click();", button);
    

    However, this is a symptom of a problem: Angular applications have a custom DOM structure that is not supported properly by WebDriver. Protractor provides the support for Angular E2E automated checking.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2