Mình bị cái lỗi sau khi chạy trên firefox:
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!
Script trong eclipse:Selenium Webdriver lỗi khi chạy trên firefox
Forum rules
Nơi trao đổi, chia sẻ thông tin liên quan đến testing tool Selenium.
Nên search trước khi post bài.
Nơi trao đổi, chia sẻ thông tin liên quan đến testing tool Selenium.
Nên search trước khi post bài.
-
- Fresher Tester
- Posts: 15
- Joined: Wed 09 Nov, 2011 1:24 pm
- Contact:
Selenium Webdriver lỗi khi chạy trên firefox
You do not have the required permissions to view the files attached to this post.
-
- Fresher Tester
- Posts: 27
- Joined: Mon 02 Jun, 2014 4:40 pm
- Contact:
Re: Selenium Webdriver lỗi khi chạy trên firefox
Đây là bạn dùng cho Selenium RC rồi chứ ko phải là selenium webdriver.
Sau đây là bài hướng dẫn cách login vào facebook mà dùng selenium trên eclipse dựa trên ngôn ngữ java :
http://tabaolan1987.github.io/blog/categories/newbie/
Hy vọng nó sẽ giúp bạn hiểu rõ hơn về Selenium Webdriver.
Sau đây là bài hướng dẫn cách login vào facebook mà dùng selenium trên eclipse dựa trên ngôn ngữ java :
http://tabaolan1987.github.io/blog/categories/newbie/
Hy vọng nó sẽ giúp bạn hiểu rõ hơn về Selenium Webdriver.
-
- Hoc Tester
- Posts: 1
- Joined: Fri 07 Apr, 2017 4:57 pm
- Contact:
Re: Selenium Webdriver lỗi khi chạy trên firefox
Em cũng bị lỗi trên firefox với javascript vì chưa biết khai báo gecko:
Mong được giúp đỡ #_#
Code: Select all
var webdriver = require('selenium-webdriver/firefox'),
By = webdriver.By,
until = webdriver.until;
var driver = new webdriver.Builder()
.forBrowser('firefox')
.setFirefoxOptions(
.build();
driver.get('http://www.google.com/ncr');
driver.findElement(By.name('q')).sendKeys('webdriver');
driver.findElement(By.name('btnG')).click();
driver.wait(until.titleIs('webdriver - Google Search'), 1000);
driver.quit();