It is necessary to verify the entered text using a global variable and the entered random values.
In my case, the output of random text to the text input window using a global variable and verification of the entered text.
How exactly can I do this?
Tried through .getAttribute and .getText but unsuccessfully
(.getText) the step goes well, but at the verification step it may give an error
Step Web UI.getText(find the test object (name “Object Storage/Bus stops and scenarios/Page/operation”), failure handling.STOP_ON_FAILURE)
Object text ‘Object Storage/Bus stops, adding scripts/page/operation name’ looks like this: ’ ’
in other cases
Unable to verify equal between actual objects " and expected object
katalon studio Unable to verify match between actual text ‘null’ and expected text
If you review the Intelli-sense of the “verifyElementAttributeValue”, you will see that the “value” is the attribute that you are wanting to verify. Generally, for a textbox or textarea, the “value” attribute is where you will find the specific content or text of the element–in your image, it looks like you have “qwrewqe”. You can use the Dev Tools to review all the attributes of an element to see which one contains the information you are looking for. As an example, you may review the “title” attribute if there is some helptext or “class” attribute is there is something associated with it, like it contains “colorRed”.
Edit: I also use the below statement when I want to use RegEx matching on an attribute: WebUI.verifyMatch(WebUI.getAttribute(findTestObject('.../name_OP'), 'class'), '.*colorRed.*', true)
or WebUI.verifyMatch(WebUI.getAttribute(findTestObject('.../name_OP'), 'class').contains('colorRed').toString(), "true", false)