Micro Focus QTP (UFT) Forums
Multiline text validaion - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Multiline text validaion (/Thread-Multiline-text-validaion)



Multiline text validaion - Murali4426 - 02-03-2014

Hi All,
i have a scenario like "i have to validate the multiline text message .it is displaying in a POP up".
please respond as early as possible.

Code:
myString1=Browser("Login").Dialog("Message from webpage").Static("objectName").GetROProperty("text")
'myString2="The selected XXX is not allowed to receive XXXXX materials."+Chr(13) & Chr(10)+"You can not proceed with this order using this XXXX"
if myString1=myString2 Then

msgbox "True"

End if
Thanks,
Murali.


RE: Multiline text validaion - supputuri - 02-04-2014

Option 1:
Use the regular expression object to validate the content.
Option 2:
Define the "objectName" property with the expected text, and use the regular expression in the place of "X"s'. And then go with exist, if true pass else fail.

Option 2 is simple and easy.