selenium rc java_如何用 Selenium RC 进行自动化测试

将selenium IDE里导出的login.java文件,导入到com.example.tests包里。

代码内容如下:

package com.example.tests;import com.thoughtworks.selenium.*;import org.junit.After;import org.junit.Before;import org.junit.Test;import static org.junit.Assert.*;import java.util.regex.Pattern;public class login {private Selenium selenium;@Beforepublic void setUp() throws Exception {selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://test.51ebill.com:55554/ebillwww/manage/login.in");selenium.start();}@Testpublic void testLogin() throws Exception {selenium.open("/ebillwww/manage/login.in");selenium.type("id=name", "yuguotai");selenium.type("id=psw", "88@88.com");selenium.click("id=submitForm");selenium.waitForPageToLoad("30000");selenium.click("link=[退出]");selenium.waitForPageToLoad("30000");}@Afterpublic void tearDown() throws Exception {selenium.stop();}}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值