Question / Object doesn't support this property (Exist) - 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: Question / Object doesn't support this property (Exist) (/Thread-Question-Object-doesn-t-support-this-property-Exist) |
Question / Object doesn't support this property (Exist) - sbattisti - 12-14-2011 Hi folks, I'm a QTP beginner (surprise!). I have a trial version of QTP 11 (build 1018), and am playing around to see if it might be a valuable addition for our company. (Incidentally, the "Posting Guidelines" hyperlink in the "please read this" thread is dead, so I'm winging it here as best I can. I have gone through the QTP tutorial, and found it very helpful.) So, I figured I would try to build a very simple test based on the login screen of our .NET windows application. It's a very simple screen with some labels, a password field, and OK/Cancel buttons. I have the .NET, Web, and WPF add-ins activated, although I confess I'm not a developer and am not 100% certain I'm doing this right. I'm running on Win 7 Pro, SP 1. I set up a test, and used "Navigate and Learn" to create the object repository. It successfully found the objects on the screen. In my test, I tried to simply test whether or not a given label exists on the screen. I did this by selecting the "Project Code" label item and the "Exist" operation from the Keyword view. The Expert View shows this: Code: SwfWindow("MyScreen").SwfLabel("Project Code:").Exist However, when I run the test, it immediately says, "Object doesn't support this property or method: 'SwfWindow(...).SwfLabel(...).Exist'". When this didn't work, I tried a Click operation on one of the buttons, and that seemed to work. I've tried Googling this a bit, but haven't come across anything obvious. I was hoping that I'd have luck getting this simple test done, but so far, no love. Can anyone point me in the right direction? I'm happy to answer any questions I can... Thanks! ~Steve RE: Question / Object doesn't support this property (Exist) - ravi.gajul - 12-15-2011 The line SwfWindow("MyScreen").SwfLabel("Project Code:").Exist returns a boolean value i.e.,"true" or "false" .Hence we are supposed to either assign the above statement to a variable or use it in a conditional statement.The two codes shown below demonstrates the usage Code: strChk=SwfWindow("MyScreen").SwfLabel("Project Code:").Exist Code: If SwfWindow("MyScreen").SwfLabel("Project Code:").Exist Then Regards, Ravi RE: Question / Object doesn't support this property (Exist) - sbattisti - 12-15-2011 Thanks, that helps! Although, I must confess, I've been playing around with QTP more using the GUI than coding (I'm not a coder). Still, I was able to make some progress... Thanks! ~Steve |