Forum Discussion
Thanks for the reply. It worked for me I am able to select the desired row and click on it. I have used do while loop so if the condition is false then also the element should be verified once.
I have one additional doubt here - if we have button which is enabled in one screen but disabled in another screen how should we verify that. I am putting a condition in while loop as mentioned "while(x.Enabled == true)". but my loop is not stopping even though the button has become false. Is there any solution to check this.
Even though it looks the same to you, the button probably has a slightly different object name on the other page. You might not be able to call it "x" all the way through the test. It might need to be Page1x and Page2x and you check for enabled separately for the two.
- Vars014 years agoOccasional Contributor
Thanks AlexKaras Marsha_R I tried giving two separate object name/xpaths but it is not working for me,in first page only it starts looking at both the objects and the script fails. It might be due to my lack of coding knowledge but I am not getting how should I use 2nd object name. Could you please tell me where should I put 2nd/disabled object/xpath in the below mentioned code. In the below mentioned code I am trying to get the row counts for all the pages.
function Test()
{var TotalCount;
do
{
var RowCount = Aliases.browser.pageSapiensDecision.FindElements("xpath for Rows");TotalCount = TotalCount+RowCount.length;
//Enabled Next button
var Next_Button = Aliases.browser.pageName.ObjectName;
Next_Button.click();
}while (Next_Button.Enabled == true)
Log.Message(TotalCount);
}
Related Content
- 5 years ago