SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    May 2009
    Location
    Las Vegas, NV, USA
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Can\'t Get QTP to Set a WebList Value

    Hi all,

    I've tried everything I can think to try over the last two days and I'm stumped. Something that should be very easy (and is something I've done before without any problem), is now not working.

    I am having QTP read a value off of Screen A, wanting it to be selected where it appears on Screen B. Reading the value (and displaying it via Print) works fine. I've used Object Spy and introduced Check Points to determine everything there is to know about the WebList on Screen B, and setting the value isn't working. The value DOES appear in the WebList, so I'm stumped as to why it won't work.

    Here's a few more details...

    Screen A - Provides the value "65355" which I'll need for Screen B and assign to the variable name "AppID".
    Screen B - Contains a WebList file which has a varying number of values, including "65355". Here's the various command I've tried and tried, with no success, to get the value to appear in the field:

    Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").Select AppID

    and

    Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").Set AppID

    and

    Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").Object.value = "65355"

    Any assistance would be highly appreciated.
    Mike

  2. #2
    Super Member
    Join Date
    Dec 2005
    Location
    USA
    Posts
    1,407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Can\'t Get QTP to Set a WebList Value

    mike give a try with the below code.

    <font class="small">Code:</font><hr /><pre>

    If Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").Exist(10)The n
    strCount=Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").GetRoPropert y("items count")

    for i = 0 to strCount

    strValue=Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").GetItem(i)

    if Trim(strValue)=trim(AppID) then
    Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").Select strValue
    Exit for
    end if

    next

    End if
    </pre><hr />
    ------------
    Chikki
    when things gets harder ,the harder gets going

  3. #3
    Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    374
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can\'t Get QTP to Set a WebList Value

    You can also try this code:

    strList = Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").GetROPropert y("all items")
    strArray = Split(strList, ";", -1, 1)
    LenArray = UBound(strArray)
    For k=0 to LenArray
    strValue = strArray(k)
    If strcomp(strValue, AppID, 1) = "0" Then
    Browser("Browser Name").Page("Page Name").WebList("applicationIdSelect").Select strValue
    Exit for
    End If
    Next
    - Manish

  4. #4
    Member
    Join Date
    May 2009
    Location
    Las Vegas, NV, USA
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can\'t Get QTP to Set a WebList Value

    Thanks, guys! I'll try both of those right now...cross your fingers. [img]/images/graemlins/smile.gif[/img]
    Mike

  5. #5
    Member
    Join Date
    May 2009
    Location
    Las Vegas, NV, USA
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can\'t Get QTP to Set a WebList Value

    Hmmm...I started first with yours, Chikki. Subbed in all of the browser and page info, yet when it gets to taking a count of the items in the list:

    (strValue=Browser("BrowserName").Page("PageName"). WebList("applicationIdSelect").GetItem(i))

    Its retrieving a value of 0. I counted 19 items in the list. And this is the problem I keep having...that it won't read "items count".

    Finally, in an act of desperation, I asked one of the developers what might be unique about this field that it would work this way. Bingo! He knew. This field is populated via AJAX calls, so IE (v7 and QTP 9.5) is viewing the field as empty. PRESTO! Now its clear as to why.

    The NEW question is...does anyone know how to overcome this type of situation with AJAX calls?

    Thank you both, Chikki and Mann...your assistance went far into helping me move this problem forward.
    Mike

  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: Can\'t Get QTP to Set a WebList Value

    Spy the WebList and post a screenshot.
    Rajkumar

  7. #7
    Member
    Join Date
    May 2009
    Location
    Las Vegas, NV, USA
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can\'t Get QTP to Set a WebList Value

    I found that QTP v9.5 does not support AJAX calls, but per this thread (http://www.learnqtp.com/forums/archi...read-4809.html) QTP v10 has limited support and QTP v11 has better AJAX support. Looks like I'm stuck.
    Mike

 

 

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.00%
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 02:45 AM.

Copyright BetaSoft Inc.