Forum Discussion

asmatullah's avatar
asmatullah
Contributor
10 years ago

Problem in finding "VCLObject"

Hi Experts ,



I am getting problem with finding "VCLObject".

Problem is that When I use Object Spy ,It gives me diffent  types of Full names .

Ex :

Condition 1.       Sys["Process"]("MainApp")["VCLObject"]("MOPMainApp")["VCLObject"]("PlantArea")["VCLObject"]("AlarmList")["VCLObject"]("AlarmsList1")

 

Condition 2.    Sys.Process("MainApp").Window("TMOPMainApp",MOPMainApp",1).VCLObject("PlantArea").VCLObject("AlarmList").VCLObject("AlarmsList1")

 

If I get the First Condition 1,I am able to click on buttons of the Application .But if get the Condition 2, I am not able to Click on the Buttons .



Also If the Second conditions appears I restart Application . 

Now I am restarting Appliacation again and again and not able to proceed for Testing .



Also What is the criteria for TestComplete to find “VCLObject” and “Window”



Please help me out .I am Stuck !



Scenario :

i) Launch Application .

ii)Wait for all application to Start .(Here I am waiting for objects to get loaded)

iii)When all Objects are loaded on Screen ,Start Testing .

iv)If Objects are not loaded properly As mentioned above in Condition 2 . I  Restart application.



Please refer to attach Image for Object Spy Details 

10 Replies

  • jose_pita's avatar
    jose_pita
    Super Contributor
    This is what i'd use in order to find the object and click it (my code is in javascript, that syntax in the fullName does not seem like javascript, maybe Tanya can help you with that):





    function clickMyObject(propertyName, propertyValue, depth)

    {

      Sys.Process("MainApp").Find(propertyName, propertyValue, depth).click();

    }



    function myTest()

    {

      clickMyObject("ObjectIdentifier", "BtnAccess", 10)

      clickMyObject("ObjectIdentifier", "AlarmsList1", 20)

    }

  • jose_pita's avatar
    jose_pita
    Super Contributor
    What about if you use Find, can you click the object?



    Sys["Process"]("MainApp").Find("Name", "AlarmsList1", 30).Click();

  • Hi Jose Pita ,



    I have check with following code :



    Sys["Process"]("MainApp").Find("Name", "AlarmsList1", 30).Click();



    But I am getting Error "You are trying to call the "Click" method or property of an object that does not exist.".



    Further I tried to debug this using below code :

     oMainObj = Sys["Process"]("MainApp")

     oStartObj = oMainObj["Find"]("Name","AlarmsList1",30000)



    and found that Inspect shows nothing  (Blank) .
  • jose_pita's avatar
    jose_pita
    Super Contributor
    Do me a favor, put an image here of the properties of the object you want to click using object spy or object browser. Mainly it's name, and some identifier (ObjectIdentifier if it exists)
  • Hi Jose ,



    Thank for the solutions , I have made some work around and its working for now .









  • Hi Experts ,



    Can anybody explain me ,What is the criteria for TestComplete to find “VCLObject” and “Window” ?  



    As mentioned in the first post Sometime I get the VCLobject and sometime Windows while execution .



    Waiting for Expert Opinions ...





  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Khan,

     


    Ideally, you need to work only with the VCLObject objects. You see Window only when the target object is loaded. It may take some time due to some complex processes that take place inside your app. You'll need to wait until the object is fully loaded (became VCLObject) to test it.


     


    You can try increasing the value of the Method invoke timeout property. It makes TestComplete wait for the object being loaded a bit longer. 


     

  • Hi Tanya ,



    Thanks for the reply , So this is the difference between both the objects .