How to verify a page is loaded in Javascript

1 reply. Last post: February 12, 2015 3:16 AM by leo Chandra
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
zak benzaMember

Hello All;

I want to verify that a specific row exists in a grid using javascript only for QA testing purposes ( the grid might have several pages), I am using the following steps;

var grid = window.ISGetObject(GridId()); 

var bfound=false;

var bfound=VerifyRowExistsInPage(Expectedrow); //this function verify all rows in the open active page and returns True if the row exist in the page false if not.

if (bfound){

return true; //if the row is found I exist the function

}

//if not I loop throw all pages of the grid until the expected row is found or I reach the last row of the grid

    currentPage = grid.CurrentPageIndex;

    totalpages = grid.TotalPages;

var currentsatatus;

    while (currentPage <= totalpages) {

        grid.GotoNextPage();

        //Wait(2000); //just I wait for about some secondes do not foucs on this function if correct or not please

        currentPage = grid.CurrentPageIndex;

currentsatatus=grid.IsInProgress

while(currentsatatus){

wait (2000);

currentsatatus=grid.IsInProgress;

}

var bfound=VerifyRowExistsInPage(Expectedrow); 

if (bfound){

return true; //if the row is found I exist the function

}

currentPage = grid.CurrentPageIndex;

}

.....

......

here the rest of the code 

My problem is when verifying if the grid is inprogress, it seems the variable in my code currentsatatus is always true

Can you help me please??

All times are GMT -5. The time now is 3:17 PM.
Previous Next