Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7622609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:29:46+00:00 2026-05-31T04:29:46+00:00

I want my code to b as dynamic as possible, here is my code

  • 0

I want my code to b as dynamic as possible, here is my 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

    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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:29:47+00:00Added an answer on May 31, 2026 at 4:29 am

    Through descriptive programming, you can catch your JavaWindow on its index property:

    Set myJavaWindow = JavaWindow("index:=0")
    

    The 0 can be parameterised of course.


    Edit after comment: To make your second example work:

    Dim myJW, i
    For i = 0 to 1023
        Set myJW = JavaWindow("index:=" & i)
        If not myJW.Exist Then Exit For
    
        msgbox "Text for JavaWindow " & i & ": " & myJW.GetRoProperty("label")
    Next
    

    To match on a JavaWindow with a certain label, you can also use Descriptive Programming like:

    myLabel = "Xyzzy!"
    If JavaWindow("label:=" & myLabel, "index:=0").exist Then
        msgbox "Woei! A Javawindow with label '" & myLabel & "' exists!"
    End if
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a Dynamic aspx Page in current solution through code-behind..forexample i
I want code to run whenever I create a new object. For example, see
I want some code to be triggered every second. Usually, I'd create a Timer
I want my code to automatically try multiple ways to create a database connection.
I want to create dymamic SQL code to automatically create a table-replication. I'm stuck
I want to dynamic create an array based on a number inside a multidimensional
i want code to check whether the user in logged in or not. I
Question: I want code for: syntax highlighting (of programming languages) Language: C# or assembly
Want to code a key pad for an calculator. What I want to make
I want to code a simple form layout in flex. Something like the following:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.