New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dehanw opened this Issue Jul 28, 2017 · 4 comments

Comments

2 participants
@dehanw

dehanw commented Jul 28, 2017

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

This comment has been minimized.

Show comment
Hide comment
@mcasperson

mcasperson Aug 6, 2017

Collaborator

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.

Collaborator

mcasperson commented Aug 6, 2017

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 added a commit to mcasperson/IridiumApplicationTesting that referenced this issue Aug 6, 2017

@mcasperson

This comment has been minimized.

Show comment
Hide comment
@mcasperson

mcasperson Aug 7, 2017

Collaborator

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.

Collaborator

mcasperson commented Aug 7, 2017

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

This comment has been minimized.

Show comment
Hide comment
@dehanw

dehanw Aug 7, 2017

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

dehanw commented Aug 7, 2017

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

@dehanw

This comment has been minimized.

Show comment
Hide comment
@dehanw

dehanw Aug 22, 2017

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
�[31mau.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/.

dehanw commented Aug 22, 2017

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
�[31mau.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/.

@dehanw dehanw closed this Aug 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment