How to get Rational Functional Tester to perform the recorded action on every row in a grid?

青春壹個敷衍的年華 提交于 2019-12-11 23:40:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!