AutoGeneral / IridiumApplicationTesting

A&G Web Application Testing Suite
https://www.gitbook.com/book/autogeneral/iridiumapplicationtesting-gettingstartedguide/details
MIT License
20 stars 13 forks source link

getText() returns empty when using the step to verify the page contains certain text (BrowserStack Edge) #109

Closed dehanw closed 7 years ago

dehanw commented 7 years ago

Used the step to verify that the page contains the certain text but failed when testing in BrowserStack Edge. The step works fine in Firefox, Chrome, and Safari at BrowserStack.

There is no available env for me to test further in local Edge browser and MicrosoftWebDriver.

Expectation: Found the text on the page.

Actual: getText() in Edge webdriver returns empty value.

Tested in BrowserStack Window: 10 browserstack.selenium_version: 3.4.0 or 3.0.1 Edge: 14 Iridium Version: 1.0.36

Test Report: @quote @capture-postcode Scenario: Capture Postcode CQS-181: P1, P2 Given I verify that the page contains the text "What is the address where the vehicle is kept regularly?" au.com.agic.apptesting.exception.ValidationException: Could not find the text "What is the address where the vehicle is kept regularly?" on the page at au.com.agic.apptesting.steps.ValidationStepDefinitions.verifyPageContent(ValidationStepDefinitions.java:350) at ?.Given I verify that the page contains the text "What is the address where the vehicle is kept regularly?"(8424204347189670123car.feature:155)

Log: No further details comparing to test report.

gettext

mcasperson commented 7 years ago

I've just added testing for Edge in Browserstack as part of the regular build, so I'll see if I can replicate this issue.

mcasperson commented 7 years ago

In 1.0.38 the text content of the screen is printed in the exception so you can see exactly what the browser thinks the web page looks like in plain text. This will help you to build the step when verification like the one above fail.

dehanw commented 7 years ago

Got it. I will download the latest 1.0.38 later and try it. Thank you for looking into it.

dehanw commented 7 years ago

Just completed the retesting on Edge with Iridium 1.0.41. And, found that the new way (getAttribute("innerText")) works fine in Chrome, Safari, Firefox as the previous way getText(). But, in Edge, it still returned empty text or null.

Test Report au.com.agic.apptesting.exception.ValidationException: Could not find the text "What is the address where the vehicle is kept regularly?" on the page with text at au.com.agic.apptesting.steps.ValidationStepDefinitions.verifyPageContent(ValidationStepDefinitions.java:342) at ✽.Given I verify that the page contains the text "What is the address where the vehicle is kept regularly?"(4797090708863883866car.feature:157)

Test Log au.com.agic.apptesting.exception.ValidationException: Could not find the text "What is the address where the vehicle is kept regularly?" on the page with text build 22-Aug-2017 11:39:02 at au.com.agic.apptesting.steps.ValidationStepDefinitions.verifyPageContent(ValidationStepDefinitions.java:342) build 22-Aug-2017 11:39:02 at ✽.Given I verify that the page contains the text "What is the address where the vehicle is kept regularly?"(4797090708863883866car.feature:157)

I do not think it is a defect or issue of Iridium and it seems it is an issue of EdgeWebDriver. So, I will close this issue later and will use the more proper step "wait several seconds for the element found by" instead for the cross-browser testing (so, getBy() instead)

I am not sure whether I should report a defect at https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/.