Java 将Selenium脚本导出为jar,我可以使用cmd提示符运行,但没有主清单
这就是我目前拥有的,我正在尝试导出它,但我没有任何主清单,也无法为其分配类。真的需要帮助,我愿意捐款给任何能给我看电视的人,告诉我如何让我的脚本成为一个可执行的.jar,我可以用cmd提示符运行 您只需使用Java 将Selenium脚本导出为jar,我可以使用cmd提示符运行,但没有主清单,java,eclipse,selenium,junit,Java,Eclipse,Selenium,Junit,这就是我目前拥有的,我正在尝试导出它,但我没有任何主清单,也无法为其分配类。真的需要帮助,我愿意捐款给任何能给我看电视的人,告诉我如何让我的脚本成为一个可执行的.jar,我可以用cmd提示符运行 您只需使用main方法创建main类,并指向testclass 请参见下面的我的代码: import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; im
main
方法创建main
类,并指向testclass
请参见下面的我的代码:
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
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 Hello extends SeleneseTestCase {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", "http://bakersfield.craigslist.org/search/sss?query=plumbers&sort=rel");
selenium.start();
}
@Test
public void testPlumbers() throws Exception {
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
希望有帮助
public static void main(String[] args) {
JUnit junit = new JUnit();
junit.setTestClasses(new Class[] { Hello.class });
junit.run();
}