User Tag List

Results 1 to 4 of 4
  1. #1
    New Member
    Join Date
    Mar 2013
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)

    Question Pagination Not working properly

    Hi All,
    I have an issue with pagination controls in one of our web applications. The pagination is contained in a webtable which has a textbox to enter page number and a webbutton to click. So we enter the page number in the editbox and click the button to go the respective page.

    The script which i have written is, i am searching for a value in another webtable and if it is not found, i need to enter the next page number and click the button and got the next set of results. The issue is , i am able to navigate for the first time i.e to page2; However, when the result is not found in page 2, my script tries to go next page. At this time, the action i perform on the editbox and the button are not recognized. Pls can anyone let me understand why is this not working

    Note: When i click the button, the entire page refreshes, i am not sure if that would make any issue. Given below is the script

    Public Function GotonextPage_Web(ByVal PgeObj, PgeTitle,CurrentPage, TotalPage)
    Dim TotalCols
    Dim TblObj
    Dim Temp
    Dim FOUND
    If EndTestIter Then
    Reporter.SetContext ReportEventInContext(micFail, "Ending test run.", ExitOnFailNum & " fails in a row have occured in this component. Returning to the navigator form and ending test run.")
    End If
    On Error Resume Next
    procedure="Get record for "&DataValue&" matching partially or complete value in column "&ColumnName&" on table "& Pgeobj.ToString() &"."
    'verify if the page exists
    If not PgeObj.exist(0) Then
    ReportEventWithHTML micFail, procedure, "The Page passed wasn't found."
    Exit Function
    End If
    'Verify the currentpage and total page parameters are valid

    '************************************************* ************************************************** ************************************************** ************************************************** *****************************
    'verify if the current page is less than total page and determine the total number of columns accordingly
    If CurrentPage=1 and TotalPage=1 then
    Elseif CurrentPage=1 and CurrentPage<TotalPage then
    Elseif CurrentPage<TotalPage then
    Elseif CurrentPage=TotalPage then
    'ReportEventWithHTML micFail, procedure, "The CurrentPage you are in cannot be greater than the total pages. Please check your parameters"
    'Exit Function
    End If
    Set oDesc = Description.Create()
    oDesc("micclass").Value = "WebTable"

    Set TblObjcollection = PgeObj.ChildObjects(oDesc) ' Getting the list of all Webtables under the given page
    NumberOfTables = TblObjcollection.Count() ' Getting the count of all webtable objects

    For i=0 to NumberOfTables-1
    TBLInnertxt=TblObjcollection(i).getroproperty("inn ertext") ' Getting the innertext property of the each webtable object in the page and comparing if it has the Pagination control objects

    If mid(trim(Tblinnertxt),1,5)="Page " or mid(trim(Tblinnertxt),1,13)="Results Found"Then
    Exit for
    End If
    If FOUND=TRUE Then
    Browser("application").Page(PgeTitle).Webedit("GoT oEditbox").Set CurrentPage+1 ' Enter the next Page number
    Browser("application").Page(PgeTitle).WebButton("G oButton").Click
    elseIf FOUND=FALSE Then
    ReportEventWithHTML micFail, procedure, "The Searched table/Value was not found."
    End If
    End function

  2. #2
    Super Member QAGanesh's Avatar
    Join Date
    Sep 2010
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)
    I think you need to use another for loop for the pages, i mean for i=currentpage to totalpages and in each page do the search.

    Here you are just searching the first page!!!!!
    Ganesh Iyer
    Winds of Change

  3. #3
    SQA Knight
    Join Date
    Jun 2008
    Post Thanks / Like
    3 Post(s)
    1 Thread(s)
    That's...rather messy.

    But if it's working for your first call of this function but not the second. I imagine you need to use .RefreshObject on the webedit and webbutton to reidentify them on the new page. Either that or their definition in your Object Repository is incorrect or the pgetitle being passed in is incorrect.

  4. #4
    New Member yogi shukla's Avatar
    Join Date
    Mar 2013
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)
    Symptom: Object not recognize during navigation

    Browser("application").Page(PgeTitle).Webedit("GoT oEditbox").Set CurrentPage+1
    1. Object hierarchy changing ; either PgeTitle is not properly recognize or GoT oEditbox ( also verify if webtable is coming in between)
    2. Object hierarchy is correct but object is changing 'GoT oEditbox'

    1. Try to get the pagination object by DP
    2. try to refresh Objects before performing any action
    or 3. Try to regularize object in OR for handle dynamic value change.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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:19 PM.

Copyright BetaSoft Inc.