Closed umeshshende closed 2 years ago
Does this work for you ? https://github.com/paul-hammant/ngWebDriver#waiting-for-angular-to-finish-async-activity
No.we are doing for the angular 8 now but when we trying to retrieve the object it say angular is not defined. Do you have examples for angular 8 using ngWebDriver accessing reactive form element
I'm not sure what you're telling me. Are you saying that ngWebDriver.waitForAngularRequestsToFinish();
is not to be called for Angular8 webapps?
When I check https://github.com/angular/protractor/commits/master/lib/clientsidescripts.js I note that it has not changed in two years, and the version I have copied into ngWebDriver (and released) is the same as the version that ships with Protractor today.
I've got the same issue, If I run the following test code:
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
WebDriver driver = new ChromeDriver();
NgWebDriver ngDriver = new NgWebDriver((JavascriptExecutor) driver).withRootSelector("[aio-shell]");
driver.get("https://angular.io/");
ngDriver .waitForAngularRequestsToFinish();
ngDriver.getLocationAbsUrl();
It throws me the error on the last line getting the url:
javascript error: angular is not defined (Session info: chrome=87.0.4280.66) Build info: version: '3.141.59'
Versions:
@bonapat What would be the Angular element in that page that you would interact with?
I want to test a customer angular application and I get that particular error. Just wanted to show that it‘s also reproducible on angular.io page.
On 23 Nov 2020, at 14:26, Paul Hammant notifications@github.com wrote:
@bonapat What would be the Angular element in that page that you would interact with?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
I can't immediately see any Angular widgets that are shown. The sidebar is closed. I don't know what to click on to open the sidebar. When I do a wget to look at the source of the page before JS has kicked in element you're trying to indicate is an Angular root is empty. I don't know how to help you.
Do you know NodeJS? Maybe you can point Protractor at the same page, and then show it working as you'd expect. If it doesn't work there and you're sure it should, then you can go ahead and raise it with the Protractor team.
Accessing the element on angularjs its working fine but when angular 8 it is throwing Javascript error angular is not defined on last line where ngWebDriver has been called . We also tried with withRootSelector("app-root") as HTML used
<app-root></app-root>
NgWebDriver ngWebDriver = new NgWebDriver((JavascriptExecutor) webDriver); WebElement elem = webDriver.findElement(By.id(id)); Object obj = ngWebDriver.retrieve(elem,"companyData");
Reactive form is used in angular 8