Selenium Webdriver lỗi khi chạy trên firefox

Nơi các bạn có thể tìm thấy mọi thông tin cần thiết về Selenium testing tool
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.
Post Reply
tamtran
Fresher Tester
Posts: 15
Joined: Wed 09 Nov, 2011 1:24 pm
Contact:

Selenium Webdriver lỗi khi chạy trên firefox

Post by tamtran »

Mình bị cái lỗi sau khi chạy trên firefox:
2.jpg
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!
You do not have the required permissions to view the files attached to this post.



tabaolan1987
Fresher Tester
Posts: 27
Joined: Mon 02 Jun, 2014 4:40 pm
Contact:

Re: Selenium Webdriver lỗi khi chạy trên firefox

Post by tabaolan1987 »

Đâ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.



conrua
Hoc Tester
Posts: 1
Joined: Fri 07 Apr, 2017 4:57 pm
Contact:

Re: Selenium Webdriver lỗi khi chạy trên firefox

Post by conrua »

Em cũng bị lỗi trên firefox với javascript vì chưa biết khai báo gecko:

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();
Mong được giúp đỡ #_#



Post Reply

Return to “Selenium”