How can I verify that saved data is displayed corrrectly using Selenium + C#?
<p class="details-info-block__text"><span class="details-info-block__label">Business Address 1:</span> 1010 Priority Way West Dr</p>
I want to verify the address value (e.g. "1010 Priority Way West Dr"). But retrieving it using XPath
//span[contains(text(), 'Business Address 1')]/..returns the following string
Business Address 1: 1010 Priority Way West Dr
- You get a string, and you know what that string should end with.
- There is https://docs.microsoft.com/en-us/dotnet/api/system.string.endswith?view=netframework-4.8
- You can use that, it's probably enough.
- If you know the allowed variations of Business Address 1: then you can remove those from the string.
- Maybe you know that your answer should always be after the first semi colon