Reputation: 1
I'm facing a problem editing a Rational Function Tester script. I have an application to test where the user creates a request for different company products. All the requests are set vertically in a grid, and all the requests have the same view button to provide further data.
I need to verify the existence of data in all the requests via the view button. I recorded a script where I click the view button, verify the existence of data, and then come back to the main screen and perform the same cycle with the second view button.
How can I get RFT to perform this verification with all the view buttons?
Upvotes: 0
Views: 1461
Reputation: 2482
You will want to use the find
function to get a list of all the View buttons, and then use a loop to click through all of them. Something like the following:
TestObject[] buttons;
buttons = document_myPage().find(atDescendant(".text", "View", ".class", "HtmlButton"), false);
for (int j = 0; j < buttons.length; j++)
{
GuiTestObject currentButton = (GuiTestObject)buttons[j];
currentButton.click();
//more code here...
}
Upvotes: 1