使用 Rational Functional Tester V8.1 来自动化 Web 应用程序的集成测试
2010-05-13 00:00:00 来源:WEB开发网代码行 1. Script1.java 脚本的代码
import resources.Script1Helper;
import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.object.interfaces.SAP.*;
import com.rational.test.ft.object.interfaces.WPF.*;
import com.rational.test.ft.object.interfaces.dojo.*;
import com.rational.test.ft.object.interfaces.siebel.*;
import com.rational.test.ft.object.interfaces.flex.*;
import com.rational.test.ft.object.interfaces.generichtmlsubdomain.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
import com.ibm.rational.test.ft.object.interfaces.sapwebportal.*;
public class Script1 extends Script1Helper
{
public void testMain(Object[] args)
{
startApp("http://localhost:9080/JSPandServletExample/Form/FormIntro.html");
link_runThisSample().click();
text_firstname().click(atPoint(119,13));
browser_htmlBrowser(document_simpleFormExample(),DEFAULT_FLAGS).inputChars("John");
text_lastname().click(atPoint(112,11));
browser_htmlBrowser(document_simpleFormExample(),DEFAULT_FLAGS).inputChars("Doe");
text_street().click(atPoint(108,9));
browser_htmlBrowser(document_simpleFormExample(),DEFAULT_FLAGS).inputChars("Tranq.");
text_city().click(atPoint(107,12));
browser_htmlBrowser(document_simpleFormExample(),DEFAULT_FLAGS).inputChars("Campnas");
text_state().click(atPoint(106,14));
browser_htmlBrowser(document_simpleFormExample(),DEFAULT_FLAGS).inputChars("SaoPaul");
text_zip().click(atPoint(102,11));
browser_htmlBrowser(document_simpleFormExample(),DEFAULT_FLAGS).inputChars("1308478");
text_phone().click(atPoint(105,8));
browser_htmlBrowser(document_simpleFormExample(),DEFAULT_FLAGS).inputChars("1234567");
text_email().click(atPoint(101,12));
browser_htmlBrowser(document_simpleFormExample(),DEFAULT_FLAGS).inputChars("d@t.com");
text_firstname().setText(dpString("firstname"));
text_lastname().setText(dpString("lastname"));
text_street().setText(dpString("street"));
text_city().setText(dpString("city"));
text_state().setText(dpString("state"));
text_zip().setText(dpString("zip"));
text_phone().setText(dpString("phone"));
text_email().setText(dpString("email"));
link_submit().click();
String ResultForm_Title = String)document_resultForm().getProperty(".title");
form_myForm().click();
}
}
Tags:使用 Rational Functional
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接