0

I m using the QTP tool to perform automation on wordaddin. I want to know how to identify the object by its properties and not by its coordinates. I m pasting the code here to describe my requirement Window("Microsoft Word (Product").WinObject("ATL:0C2817D0").Click 346,250.

this is the code that is generated when we click on the record button. I want to identify the object by its properties and not by the coordinates. It should not use the static coordinate, since the object may be resized or maximised or minimised. It should be independent of the coordinates.

Thank you

Amol Chavan
  • 3,835
  • 1
  • 21
  • 32
neha
  • 9
  • 1
  • what properties this object displays by use of Object Spy? – Amol Chavan Jun 14 '12 at 10:59
  • it actually identifies the activex object as a winobject. and the properties are native class and regexwndclass. please let me know how to identify an activex objects in QTp. – neha Jun 18 '12 at 06:54
  • Make sure that ActiveX plugin is enabled for script – Amol Chavan Jun 18 '12 at 06:57
  • yes the activex plugin is enabled.. – neha Jun 18 '12 at 08:58
  • yes the activex plugin is enabled..the problem is i want to perform automation on a word addin. and the object is an activex control, so when i record its specific to the coordinates like i mentioned above. is there any way so that we can programmatically provide the properties of activex object. I want a way to write an interface and through that interface expose the methods present in the word addin dll. could you please suggest a way out – neha Jun 18 '12 at 09:07
  • i am not able to understand what you really want to do? If you want to Check functions that addin support, you can write custom class in vb script which will have function you want to test, then create instances of class & call the function – Amol Chavan Jun 19 '12 at 04:04
  • if possible please provide me with sample code, since i m new to qtp. it will be of great help to me.thanks a lot – neha Jun 19 '12 at 05:00
  • No one will write code for you.Please follow link http://relevantcodes.com/qtp-using-classes-as-test-modules-i/ – Amol Chavan Jun 19 '12 at 05:26

1 Answers1

0

Normally you don't automate MSWord/Excel etc etc by objects stored in OR. Like you are doing.

Better to create object for MSWord by code & then perform operation on MSWord by using that object.

 Set ObjWord= CreateObject("word.application")

Then this ObjWord is used for further operation