I would like to suggest a different implementation of the XClick Relative to be an XVerify Relative. I have a few different applications I test that look similar, but are set up differently. I would like to verify that the status is changing when my tests run. I would love to use an X…Relative to test that the empty space next to the word “Status” (wherever it is on the page) changes.
If there’s already a way to do this that I am just missing, please let me know!
As shown below, the location of the field I’m looking for is changing from app to app, but the word “Status” always looks the same. I would like the ability to verify that whatever text is in the space next to the word “Status” is changing when I interact with the record in such a way that would result in a status change.
There might be a way to do this with involved xpath/css, but it would be nice if that weren’t necessary. Since the ability to determine whether an image is available to click on it already exists, it doesn’t seem like a huge leap to use that functionality to determine whether an image is visible on the page or not.
SourceExtract: If the words status: ... are visible in the page source code, you can avoid XPath and simply use SourceExtract with a regular expression to get the words next to status.
Test macro: Status1: TR Div Chief Approval
Here in the forum this solution would work well. See the tesr macro below. It extracts the TR Div Chief Approval from this forum post.
Use XType to send CTRL-A and CTRL-V (mark text and copy) to the website. Now the text is in the clipboard variable ${!clipboard}. You can then use ExecuteScript (Javascript) with the same regular expression as in #2. The advantage of this is that it works even if the the raw text is not in the page source, e. g. if gets generated on the fly by some AJAX calls.
I would still very much like to see xVerify Relative implemented for ease of system use, but I’m glad to have a functional alternative. Thank you, @ulrich!