Hi, I am encountering an error within a test case, where an element cannot be found. Below is a snippet of the code, where I am attempting to verify the element text for the paragraph starting “Tickets and travelcards”:
Choose your ticket or travelcard
Please note:
Tickets and travelcards will be available to use the day after you buy them but you can purchase them up to 7 days in advance. You can only purchase one ticket at a time, and you must collect this from a smart reader before further online purchases are possible.
Product terms and conditions apply, for more information please check here. Some tickets and travelcards are restricted by card type.
Given that other “verify element text” steps work fine, I wonder whether it is the non-breaking space that is present after “travelcards”, which shows as “ ” when I inspect the code in Chrome. The website itself is developed by a supplier, so I cannot simply edit the source code to confirm this.
Below are the object properties that I am using to detect the element:
tag equals p (detect object)
text equals Tickets and travelcards will be available to use the day after you buy them but you can purchase them up to 7 days in advance. You can only purchase one ticket at a time, and you must collect this from a smart reader before further online purchases are possible.
(detect object)
xpath equals id(“center”)/div[@class=“groupBlockA blockAFull”]/div[@class=“lifted basket-page”]/span[@class=“spaceRemainingOnCard”]
Below is the error displayed within the console:
[FAILED] - Test Cases/Purchase Metrolink Single Adult FAILED because (of) Verify element text of test object ‘Object Repository/GMT Portal - Production/Page_Select a ticket or travelcard/p_Tickets and travelcards will’ FAILED. (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/GMT Portal - Production/Page_Select a ticket or travelcard/p_Tickets and travelcards will’ located by 'By.xpath: //p[(text() = 'Tickets and travelcards will be available to use the day after you buy them but you can purchase them up to 7 days in advance. You can only purchase one ticket at a time, and you must collect this from a smart reader before further online purchases are possible.
’ or . = 'Tickets and travelcards will be available to use the day after you buy them but you can purchase them up to 7 days in advance. You can only purchase one ticket at a time, and you must collect this from a smart reader before further online purchases are possible.
‘)]’ not found)
Can anyone help me with this?