Hi Paul, If you need any further information please let me know. It would be helpful if you could help me with this issue, or suggest any work around. Thanks.
I wrote a simple angular app shown in the link https://angular-tour-of-heroes-1a2a8.web.app/
When i am trying to access the model "hero.name" with .withRootSelector("\"app-root\"") or .withRootSelector("\"app-heroes\"") i am yet facing the error "angular is not defined".
Can you please suggest me how to proceed. I tried to use a very simple app located at the path https://github.com/suhailsqm/angular-tour-of-heroes.git but yet facing the same error.
You'll have to make me the JAVA test repo that uses nGWebDriver too. A reproducible thing. Something that uses https://angular-tour-of-heroes-1a2a8.web.app/ and has the least lines of code necessary for me to see what the problem is.
I am trying to access a web element in angular app using model, i can acheive the same using id but i was very well looking forward to using binding or model in angular app. Even after acheiving to send keys using id, i am unable to synchronize my automation suite(testing angular) as i see ngWebDriver.waitForAngularRequestsToFinish(); is not doing what it promises to do.
even the below code which i found online is not doing the needed, i.e waiting for the particular angular element to be rendered/loaded before subsequent test steps are executed.
I have used the below code at which i am getting the error. I am running using java, selenium and testng framework.
WebElement stateSelect = driver.findElement(ByAngular.withRootSelector("\"app-create-customers\"").model("state"))
Please find the error in the below logs. Issue Logs.txt;
I have chosen the right root selector and also the model.
My Html doc in angular app looks like so.
On inspecting the web element the html code looks something like this, which seems that i have chosen the right root selector.
I have already raised this issue here but no response. https://stackoverflow.com/questions/72938900/getting-this-error-org-openqa-selenium-javascriptexception-javascript-error-a
Please go through this document for complete information.
i am getting the same error, after trying in firefox, chrome v102 & chrome v104.
Make a Github repo with one Java class and a pom.xml that gives me a reproduction and I'll take a look
Hi Paul, Please find the github repo https://github.com/suhailsqm/FirstTestNG.git Thank you.
Hi Paul, If you need any further information please let me know. It would be helpful if you could help me with this issue, or suggest any work around. Thanks.
Root selector is wrong, I think. This one is wrong
withRootSelector("\"app-create-customers\"")
, should be as screenshotI wrote a simple angular app shown in the link https://angular-tour-of-heroes-1a2a8.web.app/ When i am trying to access the model "hero.name" with .withRootSelector("\"app-root\"") or .withRootSelector("\"app-heroes\"") i am yet facing the error "angular is not defined". Can you please suggest me how to proceed. I tried to use a very simple app located at the path https://github.com/suhailsqm/angular-tour-of-heroes.git but yet facing the same error.
You'll have to make me the JAVA test repo that uses nGWebDriver too. A reproducible thing. Something that uses https://angular-tour-of-heroes-1a2a8.web.app/ and has the least lines of code necessary for me to see what the problem is.
Hi Paul, https://github.com/suhailsqm/FirstTestNG.git Please find the latest code in the above repository.
mvn install
doesn't identify any tests.I added the tests in
mvn install
. Can you please check it now.This works for me --->
I didn't understand the findElement(..) the way you were trying to do it. I've fixed it - see above.
I am trying to access a web element in angular app using model, i can acheive the same using id but i was very well looking forward to using binding or model in angular app. Even after acheiving to send keys using id, i am unable to synchronize my automation suite(testing angular) as i see
ngWebDriver.waitForAngularRequestsToFinish();
is not doing what it promises to do.even the below code which i found online is not doing the needed, i.e waiting for the particular angular element to be rendered/loaded before subsequent test steps are executed.
I need to automate testing of my company's website soon. Nevetheless thank you for your help.
Possibly a shadow-dom thing that I'm unfamiliar with - sorry