Twill: http://twill.idyll.org/
Selenium 使用介绍: http://www.iteye.com/topic/107276
官方网站: http://www.openqa.org/selenium/
中文资源: http://wiki.javascud.org/display/SEL/Home
Twillan安装请参阅python easy_install。附件有脚本。
示例脚本:
1.tw.twill:
go http://www.python.org/
showforms
setlocal query "twill Python"
go http://www.google.com/
fv 1 q $query
submit btnI # use the "I'm feeling lucky" button
show
2.Selenium Remote Control:
JiGou_TJ .java文件
package tests;
import java.util.Random;
import org.openqa.selenium.server.SeleniumServer;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.SeleneseTestCase;
import com.thoughtworks.selenium.Selenium;
public class JiGou_TJ extends SeleneseTestCase {
private Selenium selenium;
public void setUp() throws Exception {
String url = "http://10.0.0.17:8080";
selenium = new DefaultSelenium("localhost", SeleniumServer
.getDefaultPort(), "*firefox", url);
selenium.start();
}
public void tearDown() throws Exception {
selenium.stop();
}
public void testJiGou_TJ() throws Exception {
selenium.open("/sia4/index.jspx");
selenium.click("link=登录");
selenium.waitForPageToLoad("30000");
selenium.type("j_username", "admin");
selenium.type("j_password", "password");
selenium.click("login");
selenium.waitForPageToLoad("30000");
int i =0;
while (i<10) {
selenium
.open("/sia4/Party/InternalOrganization.jspx?_action=create&_menuId=M_O1");
// 产生一个随机数
Random random = new Random();
int random_int = random.nextInt();
selenium.type("simpleName", "机构" + random_int);
selenium.type("externalReference", "100000" + random_int);
selenium.select("organizationType", "label=总公司");
selenium.select("organizationClass", "label=一级");
selenium.select("regionClass", "label=A类");
//selenium.type("deposit", "121" + random_int);
selenium.type("seqIndex", "1");
selenium.type("foundationDate", "2007-12-13");
selenium.type("parent_text", "中英人寿保险有限公司");
//selenium.waitForPageToLoad("300000");
for (int second = 0;; second++) {
if (second >= 60)
fail("timeout");
try {
if ("parent_text".equals(selenium.getValue("中英人寿保险有限公司")))
break;
} catch (Exception e) {
}
Thread.sleep(1000);
}
//Thread.sleep(5000);
selenium.selectWindow("null");
selenium.click("link=保存");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("您的信息已成功更新"));
// Thread.sleep(5000);
i++;
Thread.sleep(5000);
}
}
}
- twill.zip (236.7 KB)
- 描述: twill and ez_setup.py
- 下载次数: 12
分享到:
相关推荐
在《An Introduction to Testing Web Applications with twill and Selenium》一书中,作者们详细介绍了如何将twill和Selenium结合使用,以便更有效地测试复杂的网页应用。这种结合利用了twill的简洁性和Selenium的...
赠送jar包:twill-core-0.6.0-incubating.jar; 赠送原API文档:twill-core-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-core-0.6.0-incubating-sources.jar; 赠送Maven依赖信息文件:twill-core-0.6.0-...
赠送jar包:twill-zookeeper-0.6.0-incubating.jar; 赠送原API文档:twill-zookeeper-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-zookeeper-0.6.0-incubating-sources.jar; 赠送Maven依赖信息文件:twill-...
赠送jar包:twill-zookeeper-0.6.0-incubating.jar; 赠送原API文档:twill-zookeeper-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-zookeeper-0.6.0-incubating-sources.jar; 赠送Maven依赖信息文件:twill-...
赠送jar包:twill-api-0.6.0-incubating.jar; 赠送原API文档:twill-api-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-api-0.6.0-incubating-sources.jar; 赠送Maven依赖信息文件:twill-api-0.6.0-...
赠送jar包:twill-api-0.6.0-incubating.jar; 赠送原API文档:twill-api-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-api-0.6.0-incubating-sources.jar; 赠送Maven依赖信息文件:twill-api-0.6.0-...
Twill是针对Laravel框架设计的一个开源内容管理系统(CMS)工具包,它的主要目标是让开发者能够高效地构建出功能强大、界面直观且高度可定制的管理后台。Twill不仅提供了丰富的预置功能,还允许开发者根据项目需求...
以上是本人在某公司做python演讲的胶片。内容涉及python概述,python的测试框架,自动化测试框架,pexpect,twill,selenium等,欢迎大家提出宝贵的建议,本人手机13530981576
赠送jar包:twill-common-0.6.0-incubating.jar; 赠送原API文档:twill-common-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-common-0.6.0-incubating-sources.jar; 赠送Maven依赖信息文件:twill-common-...
赠送jar包:twill-common-0.6.0-incubating.jar; 赠送原API文档:twill-common-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-common-0.6.0-incubating-sources.jar; 赠送Maven依赖信息文件:twill-common-...
赠送jar包:twill-core-0.6.0-incubating.jar; 赠送原API文档:twill-core-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-core-0.6.0-incubating-sources.jar; 赠送Maven依赖信息文件:twill-core-0.6.0-...
赠送jar包:twill-discovery-api-0.6.0-incubating.jar; 赠送原API文档:twill-discovery-api-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-discovery-api-0.6.0-incubating-sources.jar; 赠送Maven依赖信息...
赠送jar包:twill-discovery-api-0.6.0-incubating.jar; 赠送原API文档:twill-discovery-api-0.6.0-incubating-javadoc.jar; 赠送源代码:twill-discovery-api-0.6.0-incubating-sources.jar; 赠送Maven依赖信息...
关于Twill Twill是Laravel的开源软件包,可帮助开发人员快速创建美观,强大和灵活的自定义CMS。 通过将通用功能标准化而不损害开发人员的控制权,Twill make About Twill Twill是一个开源Laravel软件包,可帮助开发...