我正在尝试运行以下代码,但徒劳无功。
代码未编译并给出错误,因为“硒无法解析”。任何人都可以查看以下代码 -
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;
public class prashantk {
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://book.theautomatedtester.co.uk/");
selenium.start();
}
@Test
public void testAuto_1() throws Exception {
selenium.open("/chapter2");
verifyEquals("Button with name", selenium.getValue("name=but2"));
verifyEquals("chocolate", selenium.getValue("xpath=(//input[@name='verifybutton'])[2]"));
selenium.click("link=Index");
selenium.waitForPageToLoad("60000");
verifyTrue(selenium.isTextPresent("Chapter4"));
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}