问题
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?
回答1:
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...
}
来源:https://stackoverflow.com/questions/6071444/how-to-get-rational-functional-tester-to-perform-the-recorded-action-on-every-ro