Micro Focus QTP (UFT) Forums
Checkpoint for part of innertext property - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Checkpoint for part of innertext property (/Thread-Checkpoint-for-part-of-innertext-property)



Checkpoint for part of innertext property - Arlequin - 05-13-2009

Hi,

I have a checkpoint that checks the innertext property of a Webelement (DIV) The text to check ("© 2005, Mercury Interactive (v. 011003-1.01-058)") is defined as a constant value in the checkpoint properties box. It works so far, but how could I check only for a part of the innertext, eg. only check for the year ("2005")? It seems to me that in the checkpoint properties dialog box I can only check for the entire innertext!? Or would here help the constant value options dialog box with its possibility for regular expressions?

Thanks, P.


RE: Checkpoint for part of innertext property - Ankur - 05-14-2009

If the year always occur at the same place ie 2nd then do this:

  1. Use GetRoproperty to extract the text and store it in a variable.
  2. Using split function with space (" ") as delimiter put the text into the array (arr)
  3. arr(1) will have your answer.



RE: Checkpoint for part of innertext property - Arlequin - 05-14-2009

OK, thanks!
But you agree that I have to use scripting and cannot achieve this in any way within the checkpoint properties dialog box?