SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Member
    Join Date
    Dec 2007
    Posts
    38
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Validating web table records

    Hi,

    I am getting ID_Appr from data table and comparing with records in webtable. To check this logic for 80 records, qtp took about 2-3 mints. If I have more than 80 records, it will take more time. Is there any way I can finish this quicker (like DOM or any other way of validation?)

    Id_Appr = 100 (some number)
    numRows = Browser("abc").Page("abc").WebTable("No.").RowCoun t
    For i = 2 to numRows
    Set ID = Browser("abc").Page("abc").WebTable("No.").ChildIt em(i, 2, "Link", 0)
    CR_Id = ID.GetROProperty("innertext")
    Id_CR = cInt(CR_Id)

    If cInt(Id_Appr) = cInt(Id_CR) Then
    msgbox "Id matched"
    Reporter.ReportEvent micFail, "Test failed " & str_Scenario ,"failed"
    i = numRows
    End If
    Next

    Thanx

  2. #2
    Senior Member
    Join Date
    Dec 2006
    Posts
    304
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    use "exit for" when Id matched.

  3. #3
    Senior Member
    Join Date
    Nov 2007
    Posts
    124
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    Id_Appr = 100 (some number)

    With Browser("abc").Page("abc")
    For i = 2 to .WebTable("No.").RowCount
    Set ID = .WebTable("No.").ChildItem(i, 2, "Link", 0)
    CR_Id = ID.GetROProperty("innertext")
    Id_CR = cInt(CR_Id)

    If cInt(Id_Appr) = cInt(Id_CR) Then
    msgbox "Id matched"
    Reporter.ReportEvent micFail, "Test failed " & str_Scenario ,"failed"
    exit for
    End If
    Next
    End with
    Life is the Game of Luck

  4. #4
    Member
    Join Date
    Dec 2007
    Posts
    38
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    In my case, id is never going to match, but I need to check all records to ensure that id is not matched. So I need to know the fastest way to validate all records with my variable(Id_Appr)

    Thanx

  5. #5
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    Is there any thing in the link that is common all the times? the url that they point to etc...?

  6. #6
    Member
    Join Date
    Dec 2007
    Posts
    38
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    Tarun,

    url and href are same particular record and the values for these are same at the starting (https://xyz.jsp?), but different at end (url has id at the end which is unique per record)
    url = https://xyz.jsp?id=123

    heigh and html tag is same for all records

  7. #7
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    Try other way around then and see if it is fast enough

    <font class="small">Code:</font><hr /><pre>
    Set oDesc = Description.Create
    oDesc("href").value = "https://xyz\.jsp?id=.*"
    Set allLinks = B.P.ChildObjects(oDesc)

    for i = 0 to allLinks.Count -1
    id_CR = allLinks(i).GetROProperty("outertext")
    If cInt(Id_Appr) = cInt(Id_CR) Then
    msgbox "Id matched"
    Reporter.ReportEvent micFail, "Test failed " &amp; str_Scenario ,"failed"
    exit for
    End If
    next
    </pre><hr />

  8. #8
    Member
    Join Date
    Dec 2007
    Posts
    38
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    Hi Tarun,

    It is not going inside the loop. AllLinks.count is coming as zero. My object spy shows href = https://xyz.jus?Id=1234, but source code does not show href id. I am attaching the source code for your reference

    Thanx
    Attached Files Attached Files

  9. #9
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    Try this

    Set oDesc = Description.Create
    oDesc("href").value = "https://xyz\.jsp\?id=.*"
    Set allLinks = B.P.ChildObjects(oDesc)

  10. #10
    Senior Member
    Join Date
    Dec 2006
    Posts
    304
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validating web table records

    Try this pretty simple solution.
    the OuterText property in any table gives all the row and column in a table. so use inster to comapre. so no loops and single time comparison.

    example:
    tdata=Browser("abc").Page("abc").WebTable("No.").g etROproperty("OuterText")

    if instr(tdata,cInt(Id_CR))&gt;0 then
    msgbox "Id matched" Reporter.ReportEvent micFail, "Test failed " &amp; str_Scenario ,"failed"
    end if

 

 
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.34%
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 06:12 PM.

Copyright BetaSoft Inc.