|
而且,哪个API告诉你RC还有storeSelectedLabel这个方法的?
算了,我帮你改改吧……- package com.luyy.web;
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
- import com.thoughtworks.selenium.DefaultSelenium;
- import com.thoughtworks.selenium.Selenium;
- public class TestWeb_RC {
-
- Selenium selenium;
- String em = "xpath=//input[@name='email']";
- String ps = "xpath=//input[@name='passwd']";
- String button = "xpath=//button[@type='submit']";
- String title ="xpath=//title/text()";
- String re;
- @Before
- public void setUp() throws Exception {
- selenium = new DefaultSelenium("localhost", 4444, "*googlechrome", "http://www.xuedi.com/");
- selenium.start();
- }
- @After
- public void tearDown() throws Exception {
- selenium.stop();
- }
- @Test
- public void test() throws InterruptedException {
- selenium.open("/");
- selenium.type(em, "sxd5331811@12.com");
- selenium.type(ps, "123456");
- selenium.click(button);
- selenium.waitForPageToLoad("30000");
- re=selenium.getSelectedLabel(title);
- Thread.sleep(2000);
- }
- }
复制代码 |
|