标题: com.thoughtworks.selenium.SeleniumException: Not found [打印本页] 作者: yimaotao 时间: 2010-5-17 16:59 标题: com.thoughtworks.selenium.SeleniumException: Not found 拜托大家指点!!!
以下是我在用 selenium+testng时出现的错误:
com.thoughtworks.selenium.SeleniumException: Not found
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.getCommandResponseAsString(HttpCommandProcessor.java:168)
at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(HttpCommandProcessor.java:104)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:86)
at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:335)
at swpu.testSwpu(swpu.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:643)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:559)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:723)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1027)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:137)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:121)
at org.testng.TestRunner.runWorkers(TestRunner.java:953)
at org.testng.TestRunner.privateRun(TestRunner.java:633)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:316)
at org.testng.SuiteRunner.run(SuiteRunner.java:195)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:903)
at org.testng.TestNG.runSuitesLocally(TestNG.java:872)
at org.testng.TestNG.run(TestNG.java:780)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:75)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:127)作者: 小米啊 时间: 2010-5-17 17:00
测试类,你可以拿出来看下否作者: yimaotao 时间: 2010-5-17 17:02 标题: 测试类 import com.thoughtworks.selenium.*;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import java.util.regex.Pattern;
import com.thoughtworks.selenium.HttpCommandProcessor;
import com.thoughtworks.selenium.DefaultSelenium;
//import com.thoughtworks.selenium.SeleneseTestBase;
//extends SeleneseTestNgHelper
public class swpu extends SeleneseTestNgHelper{
public Selenium selenium = new DefaultSelenium("localhost", 8080, "*firefox", "http://www.swpu.edu.cn");
@Test public void testSwpu() throws Exception {
selenium.open("/");
//selenium.clickAt("//div[@id='sasFlashFocus27']/embed[@id='27']", "");//媒体模块
//selenium.click("//div[@id='imglinkone']/a[1]/img");//主页的 学生世界
clickAndSelectModalDialog("//div[@id='imglinkone']/a[1]/img");
selenium.mouseMoveAt("//div[@id='menudiv']/ul/li[1]/a", "");//学生世界页面
selenium.click("link=入学指南");
selenium.wait(300000000);
//HttpCommandProcessor commandProcessor=new HttpCommandProcessor(null, 0, null, null);
//commandProcessor.executeCommandOnServlet(arg0);
}
public void clickAndSelectModalDialog(String locator){
clickForModalDialog(locator);
//selenium.selectWindow("name=modal");
}
[Parser] Running:
C:\Documents and Settings\pliu\Local Settings\Temp\testng-eclipse\testng-customsuite.xml
FAILED: testUntitled
com.thoughtworks.selenium.SeleniumException: Not found
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.getCommandResponseAsString(HttpCommandProcessor.java:168)
at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(HttpCommandProcessor.java:104)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:86)
at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:335)
at sample.testUntitled(sample.java:10)
... Removed 22 stack frames