Setting object property using SetTOProperty in UFT

Viewed 823

Need to set a property of an object at runtime. However the property values require certain regular expression. For example -

Browser("IE").Page("newpage").WebElement("First").Settoproperty "innertext", "over.*"

It seems this is not possible except setting it through OR. Any ideas ?

1 Answers

You are correct, SetTOProperty does not change whether a property is treated as a regular expression. This means that if the property in the Object Repository is using the default "not-regex" setting, then SetTOProperty will not be able to utilise regular expressions1.

If you want to use regular expressions you should use Descriptive Programming which uses regular expressions by default (although they can be turned off).


[1] Thanks to TheBlastOne for the comment correcting my inaccuracy.

Related