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

  • Home
  • SEARCH
  • 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 8778655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:35:11+00:00 2026-06-13T19:35:11+00:00

In QTP is there any way in the code to check to see if

  • 0

In QTP is there any way in the code to check to see if a specific object exists in the object repository. I have tried the following code:

If JavaWindow(className).JavaDialog(dialogName).Exist Then
    doThisStuff
Else
    doThisStuffInstead
End If

But from what I have gleamed from the Internets, this is similar to a isVisible method, only resulting in true if the specified object is currently visible. When I use the above code I receive a “JavaDialog object was not found in the Object Repository.” Is there a method or any way to prevent this very error and check to see if the object does indeed exist?

Thank you for your time

  • 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-06-13T19:35:12+00:00Added an answer on June 13, 2026 at 7:35 pm

    I’m not sure what you’re trying to accomplish here, one typically knows if an object exists in the object repository before using it. The doubt is usually whether there is a corresponding control in the AUT (Application Under Test).

    If you really face the situation that sometimes the object is in the repository and sometimes it isn’t (I can think of several ways for this to happen but none of them make much sense) then you can use VBScript’s error handling mechanism.

    On Error Resume Next ' Turn off error handling
    ' Just check if object is in repository, there's no need to do anything with it
    Dim Exists: Exists=JavaWindow(className).JavaDialog(dialogName).Exist
    If Err.Number <> 0 Then
        doThisStuff 'Exists is still empty
    Else
        doThisStuffInstead ' Exists is properly set
    End If
    On Error Goto 0 ' Resume regular error handling
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there is any way to update shared OR(Object Repository) in QTP without having
Is there any way to make ASP.NET control QTP safe ? By QTP safe
is there any way to work with Java classes in the same of similar
I'm wondering is there any way to automate testing of Flex applications using HP
What is the most efficient way to check if the current QTP test execution
I have VBScript code which launches QuickTest Professional, executes a series of QTP tests,
Is there a way to evaluate a JavaScript function on a webpage in QTP,
As we do with Object repository. We can export the check point, merge or
In QTP each test object supports the following methods GetRoProperty GetToProperty SetToProperty GetToProperties What
is there anyway in QTP to make changes take place on all function libraries

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.