Mình bị cái lỗi sau khi chạy trên firefox:
Script trong eclipse:
package com.selenium.webdriver;
import com.thoughtworks.selenium.Selenium;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.*;
import org.openqa.selenium.chrome.*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
public class TestLoginGmail {
private Selenium selenium;
WebDriver driver;
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
String baseUrl = "https://accounts.google.com/";
selenium = new WebDriverBackedSelenium(driver, baseUrl);
}
@Test
public void testLoginGmail() throws Exception {
selenium.open("/ServiceLogin?sacu=1&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&hl=en&scc=1&checkedDomains=youtube&checkConnection=youtube%3A541%3A1&pstMsg=1");
selenium.type("id=Email", "tranvantam");
selenium.type("id=Passwd", "123456");
selenium.click("id=signIn");
selenium.waitForPageToLoad("30000");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
Hướng dẫn dùm mình fix lỗi này!