Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Script | how to get object of some open window just using its class type,Java
#1
Not Solved Sad 
I want my code to b as dynamic as possible, here is my code
Code:
Set buttonDesc = Description.Create()
buttonDesc("Class Name").Value = "JavaButton"

Set reqButton = JavaWindow("AKAM Application").ChildObjects(buttonDesc)
text = reqButton(1).GetROProperty("label")
JavaWindow("AKAM Application").JavaButton(text).Click

here, in line 1 and 2, I have declared a property so that i can click on button using its index (1) without specifying its title, I want to do the same for the windows object, where i have to specify the title of the window "AKAM Application". The problem is that i need JavaWindow's parent class some how so that i could get it children and specify the Class Name to be javaWindow and get my desired object, but either QTP does not catch it parent, or there isnt any at all, later is possible case. Is there any way that i can get objects of all opened windows and the specify javaWindow and get my desired window? I have tried following code but it does not work, probably because my application's window does not show "JavaWindow" in its title bar, i'm not sure

Code:
Dim WinDesc
    Set WinDesc = Description.Create
    WinDesc("nativeclass").Value = "JavaWindow"
    Set WinChildren =Desktop.ChildObjects(WinDesc)
    msgbox WinChildren.count
    For i = 0 to WinChildren.Count - 1
       winText = WinChildren(i).GetROProperty("label")
       msgbox winText
    Next

Kindly Help!
Reply


Messages In This Thread
QTP Script | how to get object of some open window just using its class type,Java - by sophia.sabir - 03-07-2012, 12:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  DP Encapsulation Within Class Object TheGlovner 2 1,635 10-12-2018, 02:11 PM
Last Post: TheGlovner
Question Is there a way to create dynamic objects by declaring the type of object as parameter lotos 3 1,999 11-08-2017, 11:15 PM
Last Post: lotos
  Object doesn't support this property or method: 'window(...).window(...).winobject' senthil5683 1 3,515 07-04-2016, 07:08 PM
Last Post: venkatesh9032
  Dynamic obj rep - get text in the class (html) marcio cravo moreira 0 2,049 05-26-2015, 06:58 PM
Last Post: marcio cravo moreira
  webfile web object not identified at runtime in a java application saila123 1 2,667 02-11-2015, 08:23 PM
Last Post: Kirill

Forum Jump:


Users browsing this thread: 1 Guest(s)