Forum Discussion

kaiiii's avatar
kaiiii
Regular Contributor
7 years ago

problem to understand Propnames and PropValues

TestObj.FindEx(PropNamesPropValuesDepthRefreshTimeout)

hi , in the above line i am facing problem to understand PropNames and PropValues.
How can i put a value into them... please explain with a example
Here i am attaching an object description by using object spy.. pls try to help me according to this attachment. That will help me to learn quickly

  • If you are wanting to use Find or FindEx to search for that object, a suggested bit of code would be something like

     

    //parentObject is whatever you have designated as an ancestor of the object you are trying to find
    
    //First parameter is an array of strings representing the names of the properties to be used in the search
    
    //Second parameter is an array of strings representing the respective values of those properties for the search
    
    //Third parameter is the maximum depth down in the hierachy tree, starting with the parent object, to search for the object which has properties of those names with those values
    
    
    parentObject.Find(['ObjectType', 'ViewId'], ['Layout', 'NO_ID'], 10)
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    PropNames and PropValues are arrays to send the properties and their respected values for the object you're looking for.  For the screenshot you have given, you've already mapped the component, so there's no need to "find" it.  So, let's go with a different example....  from the same article you found the information on.

    https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/findex-method.html#example

     

     

    • kaiiii's avatar
      kaiiii
      Regular Contributor

      >>  For the screenshot you have given, you've already mapped the component
      Hi, I am writing a script... if i don't have details of target object then how can i work on it.
      So please tell me according to the attachment, what are the values can be for PropNames and for PropValues

      • shankar_r's avatar
        shankar_r
        Community Hero

        So please tell me according to the attachment, what are the values can be for PropNames and for PropValues


        I think you are not aware what is PropNames and PropValues means here. It can be a single string or it can be a array of property.

         

        Based on your screen shot,

         

        Ex1:

        if your object can be identified with one property then you can do like below,

        yourParentObject.Find("JavaClassName","ScrollView",1,true,10000);

         

        if your object needs be identified with more then one property then you can do like below,

        yourParentObject.Find(["JavaClassName","ObjectType"],["ScrollView","ScrollView"],1,true,10000);

         

        FYI, peoples who are helping here are not part SmartBear employee they are as like you.