SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Member
    Join Date
    Sep 2006
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Java DP doesn\'t recognize JavaList but QTP OR does

    Hi,

    I have a control that looks like a combobox but it's basically a JavaList. I'm able to access this JavaList if I added to the OR but QTP won't recognize the same JavaList if I use DP. Any thoughts?

    Here's a snippet
    <font class="small">Code:</font><hr /><pre> if JavaWindow("ParentWindow").JavaList("ChildList").E xist(0) then
    className = JavaWindow("ParentWindow").JavaList("ChildList").G etTOProperty("to_class")
    Set d = Description.Create
    d("to_class").Value = className
    Set a = JavaWindow("ParentWindow").ChildObjects(d)
    print a.Count
    end if </pre><hr />

    I expect a.Count to be at least 1 but it returns 0.

    Thanks,
    -W

  2. #2
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    Not sure if I understand the snippet. Are there any child objects in the JavaList("ChildList") object?

    Can you post the code, which works using OR?
    Rajkumar

  3. #3
    Member
    Join Date
    Sep 2006
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    Sorry, let me explain the code a little more.

    <font class="small">Code:</font><hr /><pre>if JavaWindow("ParentWindow").JavaList("ChildList").E xist(0) then </pre><hr />

    This line is using QTP's OR, no DP at all. It shows that the JavaList object does exist.

    <font class="small">Code:</font><hr /><pre> className = JavaWindow("ParentWindow").JavaList("ChildList").G etTOProperty("to_class") </pre><hr />

    Again, using QTP's OR JavaList object I'm able to get the class name, which is just "JavaList" in this case.

    <font class="small">Code:</font><hr /><pre> Set d = Description.Create
    d("to_class").Value = className
    Set a = JavaWindow("ParentWindow").ChildObjects(d)
    print a.Count </pre><hr />

    Lastly, I'm using the very same property I got from the OR JavaList object to create a DP object. Then I use that DP object to retrieve any JavaList objects available under the parent windows. My rationale is that since the object does exist and I'm using that object's property to identify all its parents' child objects, I should at least get 1 back on the ChildObjects count but I'm getting 0.

  4. #4
    Advanced Member
    Join Date
    Nov 2007
    Location
    India
    Posts
    686
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    When the count is 0 then the description set is not sufficient to identify object. You have received only 1 property.

    To correctly identify object you need to define all descriptive properties. [See OR Manager-&gt;Object-&gt;Descriptive Properties]
    Kind regards,
    Anand Tambey

    RSS Feed : Break To Make it Better
    A Lazy person could be the best automation professional, if he is not lazy in implementing his ideas to reduce his work. ~Anand Tambey

  5. #5
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    [ QUOTE ]

    I have a control that looks like a combobox but it's basically a JavaList. I'm able to access this JavaList if I added to the OR

    [/ QUOTE ]

    How did you add the object to the OR? Is it by Recording/Add Objects button or did you add the object using Define New Test Object button?

    Try to highlight the Object using the highlight button in OR and see if its highlighted.


    className = JavaWindow("ParentWindow").JavaList("ChildList").G etTOProperty("to_class")

    The above code will work as its retrieving the object property value from the OR.
    Rajkumar

  6. #6
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    [ QUOTE ]
    When the count is 0 then the description set is not sufficient to identify object. You have received only 1 property.

    To correctly identify object you need to define all descriptive properties. [See OR Manager-&gt;Object-&gt;Descriptive Properties]

    [/ QUOTE ]

    Why? You can have just one property/value pair and that should be enough to retrieve all the child objects, provided this value pair is matching one/more objects in the window.
    Rajkumar

  7. #7
    Advanced Member
    Join Date
    Nov 2007
    Location
    India
    Posts
    686
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    I had a doubt that property "to_class" is somewhat incorrect it could be "toolkit class".

    That is why I would like @WillRunner to check OR for added object and find correct descriptive properties for using GetToProperty.

    @Raj : For information "GetToProperty" only works with descriptive properties(not any property/value pair). Hence we would need to be sure about what are the descriptive properties.
    Kind regards,
    Anand Tambey

    RSS Feed : Break To Make it Better
    A Lazy person could be the best automation professional, if he is not lazy in implementing his ideas to reduce his work. ~Anand Tambey

  8. #8
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    @Anand,

    "to_class" is a valid property. When I said property value pair, I meant Property = to_class, Value = "The value against to_class". Only one property pair enough to describe the object, as opposed to "define all descriptive properties"

    Hope its clear.
    Rajkumar

  9. #9
    Member
    Join Date
    Sep 2006
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    @Rajkumar_Rajangam

    I added the JavaList object using OR's Add Object to Local button. It was not recorded and yes it did highlight correctly. Also just to note, using the OR object I'm able to perform everything on the control as expected such .Exist, .GetItemIndex, .Select. I didn't include these methods in the sample code since the problem is with object recognition.

  10. #10
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Java DP doesn\'t recognize JavaList but QTP OR does

    Not sure what's happening. Check if there are any special characters in the value for to_class. Post a snapshot of the OR.
    Rajkumar

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:40 PM.

Copyright BetaSoft Inc.