Hi Dhrupa,
You can create a web locator with a dynamic XPath that takes a variable value which is defined in your test case.
For example, //div[contains(text(),'Sample Text')]
In a web locator, it becomes:
//div[contains(text(),'@variable_value')]
If you are using Set_Var command to specify the random string, you can use the same variable name you used in Set_Var step in the XPath above. Once the step with the XPath is reached, the part "@variable_value" will be replaced with the value from Set_Var.
Regards,
Subject7 Team