2013-02-15 56 views
-1
package com.html; 

import com.thoughtworks.selenium.DefaultSelenium; 
import com.thoughtworks.selenium.Selenium; 

import junit.framework.TestCase; 

public class Html5 extends TestCase{`enter code here` 
    Selenium selenium1; 
    public void setUp() 
    { 
     selenium1=new DefaultSelenium("localhost",4444,"*firefox","http://live.com"); 
     selenium1.start(); 
    } 
} 

com.thoughtworks.selenium.DefaultSelenium中出現錯誤;和DefaultSelenium(「localhost」,4444,「* firefox」,「http://live.com」);線。如何在使用RC創建腳本時使用selenium-server-standalone-2.0rc2

請建議。

+0

**什麼錯誤**?! – Arran 2013-02-15 09:52:07

回答

1

第一:

什麼enter code here字符串做呢?

其次:

如果在import com.thoughtworks.selenium.DefaultSelenium;並在new DefaultSelenium一個錯誤,這是肯定的罐子是不是在classpath

selenium-server-standalone含有硒服務器類,而不是客戶端的,其中DefaultSelenium is。你必須把客戶端jar放到類路徑,那就是selenium2-java這個版本我想

0

我認爲你需要給路徑在Constructor..So到firefox.exe

selenium1 = new DefaultSelenium("localhost",4444,"*firefox","http://live.com"); Goes like 
selenium1 = new DefaultSelenium("localhost",4444,"*firefox C:\Documents and Settings\Mozilla Firefox\firefox.exe","http://live.com"); 

嘗試這一次。

相關問題