|
源程序:
package com.example;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class test0426 extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.baidu.com/");
selenium.start();
}
@Test
public void testTest0426() throws Exception {
selenium.open("/");
selenium.type("id=kw", "sdgfssfs");
selenium.click("id=su");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("SPBC887.17.br"));
selenium.click("link=SPBC887.17.br");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
执行后提示错误:
com.thoughtworks.selenium.SeleniumException: Timed out after 30000ms
如果注释selenium.waitForPageToLoad("30000")后执行提示错误:
com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: 没有权限
本人新手,刚接触selenium,请各位高手指点下,谢谢! |
|