我正在使用Selenium 2.但在运行以下代码后,我无法输入文本框.
Run Code Online (Sandbox Code Playgroud)package Actor; import org.openqa.*; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.junit.*; import com.thoughtworks.selenium.*; //import org.junit.Before; public class Actor { public Selenium selenium; public WebDriver driver; @Before public void setup() throws Exception{ driver = new FirefoxDriver(); driver.get("http://www.fb.com"); } @Test public void Test() throws Exception{ //selenium.type("id=gs_htif0", "test"); System.out.println("hi"); // driver.findElement(By.cssSelector("#gb_1 > span.gbts")).click(); selenium.waitForPageToLoad("300000000"); WebElement email=driver.findElement(By.id("email")); email.sendKeys("nshakuntalas@gmail.com"); driver.findElement(By.id("u_0_b")).click(); } @After public void Close() throws Exception{ System.out.println("how are you?"); } }
package javaapplication3;
import java.lang.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.WebDriver;
/**
*
* @author kipl74
*/
public class JavaApplication3 {
/**
* @param args the command line arguments
*/
static WebDriver driver = new FirefoxDriver();
public static void main(String[] args) {
// TODO code application logic here
String baseurl="www.google.com";
driver.get(baseurl);
}
}
Run Code Online (Sandbox Code Playgroud)
当我运行此代码时,我收到以下错误.怎么解决?
Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Command duration or timeout: 16 milliseconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12'
System info: host: 'comp74', …Run Code Online (Sandbox Code Playgroud) 我在用selenium IDE 1.10.0.我正在尝试检查产品类别中图像的存在.我应该使用什么命令来验证图像?