Ich konnte ein Problem nicht herausfinden.Selenium Java Ausgabe
Die Methode testTest1() wurde nicht ausgeführt. Es sollte yahoo.com öffnen.
package example1;
import org.testng.annotations.*;
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
public class SimpleTest extends SeleneseTestCase {
private DefaultSelenium selenium;
@BeforeSuite(alwaysRun = true)
public void setUp() throws Exception {
echo("in setup.");
selenium = new DefaultSelenium("localhost",
4444, "*opera", "http://localhost:8080/");
echo("selenium instance created:"+selenium.getClass());
selenium.start();
echo("selenium instance started. Opening website...");
}
@Test(sequential=true)
public void testTest1() throws Exception {
echo("testTest1:testing assertion.");
selenium.open("http://www.yahoo.com");
}
// Cleanup the selenium environment
@AfterSuite(alwaysRun = true)
private void stopTest() {
selenium.stop();
echo("selenium stopped.");
}
private void echo(String msg){
System.out.println(msg);
if(new Boolean(System.getProperties().getProperty("DEBUG")))
System.out.println(msg);
}
}
Das Skript wurde Öffnen nicht yahoo.com und sagt schließlich:
Total tests run: 0, Failures: 0, Skips: 0
Kann jemand mir sagen, was gebraucht wird?
Vielen Dank im Voraus.
Es sieht so aus, als ob dies nichts mit Selen zu tun hat, sondern ein Problem mit y ist Sie führen Ihre Tests durch. – jzd