I am trying to use _WebUI.verifyElementInViewport _to check that two links are displayed.
I’m using the following code to looking for two links:
WebUI.verifyElementInViewport(findTestObject('a_mobilechargesupport.com'), 0, FailureHandling.CONTINUE_ON_FAILURE)
WebUI.verifyElementInViewport(findTestObject('a_Terms Conditions'), 0, FailureHandling.CONTINUE_ON_FAILURE)
As you can see in the screenshot, neither link are visible in the viewport:
The test results come out as:
Link 1
Element position in viewport: x = 95, y = 514, width = 126, height = 13
Viewport infomation: width = 320, height = 454
The test fails, which is correct, the link is outside of the viewport.
Link 2
Element position in viewport: x = 186, y = 395, width = 95, height = 13
Viewport infomation: width = 320, height = 454
The test passes, which is incorrect. As you can see in the screenshot above, the link is not visible.
I can’t work out what’s going on!