| || |
object property value defs are case-sensitive
Using QTP 9.2 (but very likely applicable to all versions)
This tool's case-sensitivity can be most frustrating to new (and not so new [img]/images/graemlins/smirk.gif[/img]) users. vbScript itself is case-insensitive, so I have made the mistake more than once assuming that QTP would be case-insensitive as well.
In some situations it is case-insenstive, for example both of the following statements work, even though the Spy says the property value is "enabled" in lowercase:
But just as often QTP will be case-sensitive in a very related area. For example QTP uses the same object properties, such as enabled, when defining a test object in the Object Repository (and I assume this following discussion will apply equally to DP definitions). But in these situations (at <u>least</u> for the swfName property) the property definition values <u>are</u> case-sensitive.
Normally you won't run into this if you "record" statements that implicitly put test objects in your local OR, or you add them using the OR's Add Object tool. In these situations the correctly text case is captured and used.
But, if you:
- directly edit the definition into the OR
- modify an existing test object in the OR
- or, presumably, if you write DP statements
you need to be careful and use case-sensitive values.
And, here is one last related gotcha:
1. I had an existing OR test object that defined an swfTab object with the swfName=tabControlBlah.
2. I got a new build today and the programmer had changed swfName=TabControlBlah
The test failed because QTP could not find the tab. I used the OR highlight tool which said it could not find the tab when it was displayed on the screen. I did not notice the subtle capital 'T' change, and could not initially understand why the tab couldn't be recognized.
So then, leaving the original recorded test object in the OR, I did another Add Object operation. This resulted in the OR Manager simply highlighting my test object in the repository--which normally means "you already have the object recorded". So assuming the OR had been updated I again tried to highlight the tab in the application, and again the OR highlight tool said the object could not be found on the desktop.
So finally I deleted the test object from the OR and then re-added it. Now QTP is happy. I then fiddled with the case of the swfName value string and discovered what had happened.
Forwarned is forearmed -- especially with this darn tool!
-Hope this helps, Terry Horwath
P.S Search phrases: case-sensitive, case-insensitive, case sensitive, case insensitive, case-sensitivity, case sensitivity