Micro Focus QTP (UFT) Forums
Problem with ActiveX/changing text - 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: Problem with ActiveX/changing text (/Thread-Problem-with-ActiveX-changing-text)



Problem with ActiveX/changing text - toe76 - 04-05-2010

I am new to the position at this company and have been asked to review QTP scripts. I'm not overly familiar but I can make my way through. We are working on QTP 9.2.

I have the following line:
Code:
VbWindow("MDIMain").VbWindow("frmStartup").VbWindow("frmStatePick").ActiveX("St_Select").Object.Text = DataTable("State", dtLocalSheet)

Basically, the window is a second popup asking for the user to select the state where business is to be written.

What I'm finding is that it is recording a coordinate (Click 65,111) which is never consistant from 1 record to the next. So the only option I have is to use the Object.Text functionality - but this is causing problems because sometimes it will return the error "Property is read only" - which I know its open - I can SEE that's its ok. It will run through one test case fine, but the next will give there error.

My biggest question is can I get away with using something than Object.Text? Of course, any suggestions are welcome!


RE: Problem with ActiveX/changing text - manishbhalshankar - 04-06-2010

If ActiveX("St_Select") is a dropdown with multiple options in it to select, then try using;
PHP Code:
Select"#<item index>" 
The index count starts from 0.


RE: Problem with ActiveX/changing text - toe76 - 04-06-2010

I tried running it selecting on the index number of the value in the box and it returned an error that the object doesn't support his property or method: 'Select'