Selenium : The hell of Angular

Recently have some trouble automating an Application using Angular using Selenium and SerenityBDD.

I found a component that helps a lot. NGWebDriver

How to search an element and interact with it?

import com.paulhammant.ngwebdriver.ByAngularCssContainingText;

waitFor(ExpectedConditions.visibilityOfElementLocated(By.xpath("//my-form[@class='myclass']")));
find(ByAngularCssContainingText.xpath(//my-form[@class='myclass'])).click();

Also it could be handy to sometime wait that Angular load everything by using:

waitForAngularRequestsToFinish();

Also I had to revise a bit my Xpath way of working. Here is a good tutorial :  https://www.guru99.com/xpath-selenium.html

Leave a Reply