Lỗi khi chạy example đầu tiên về selenium webdriver

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
hardlovebee21
Fresher Tester
Posts: 18
Joined: Fri 05 Apr, 2013 4:04 pm
Contact:

Lỗi khi chạy example đầu tiên về selenium webdriver

Post by hardlovebee21 » Thu 18 Aug, 2016 10:31 am

Mình chạy thử 1 ví dụ đầu tiên về login thì đến lúc print ra màn hình nó báo lỗi :
"org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
72 < AMI_startup()@resource://gre/modules/AddonManager.jsm:748 < AMP_startup()@resource://gre/modules/AddonManager.jsm:2321 < AMC_observe()@resource://gre/components/addonManager.js:55 < <file:unknown>
1471490826326 addons.xpi DEBUG Calling bootstrap method install on sp@avast.com version 10.3.5.39
1471490826326 addons.xpi WARN Exception running bootstrap method install on sp@avast.com: TypeError: this.bootstrapScopes[aId][aMethod] is not a function (resource://gre/modules/addons/XPIProvider.jsm:4232:8) JS Stack trace: XPI_callBootstrapMethod@XPIProvider.jsm:4232:9 < addMetadata@XPIProvider.jsm:3141:1 < XPI_processFileChanges@XPIProvider.jsm:3255:1 < XPI_checkForChanges@XPIProvider.jsm:3428:1 < XPI_startup@XPIProvider.jsm:1884:1 < AMI_callProviders@AddonManager.jsm:872:11 < AMI_startup@AddonManager.jsm:748:1 < AMP_startup@AddonManager.jsm:2321:5 < AMC_observe@addonManager.js:55:7
1471490826327 addons.xpi DEBUG New add-on wrc@avast.com installed in winreg-app-global
1471490826372 addons.xpi-utils DEBUG Make addon winreg-app-global:wrc@avast.com visible"
Các bạn giúp mình với. Thanks

Code: Select all

package MyPackage;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;

public class MyClass {
	public static void main(String[] args) {
		   //Create a new instance of Firefox Browser
	       WebDriver driver = new FirefoxDriver();

	       driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
	       
	        //Launch the facebook
	        driver.get("https://www.facebook.com/");
	 
	        
	        // Find the element that's ID attribute is 'email' (Username)
	        // Enter email on the element found by above desc.
	      driver.findElement(By.id("email")).sendKeys("enter your username login to facebook");
	 
	        // Find the element that's ID attribute is 'pass' (Password)
	        // Enter Password on the element found by the above desc.
	         driver.findElement(By.id("pass")).sendKeys("enter your password login to facebook"); 
	 
	        // Now submit the form. WebDriver will find the form for us from the element 
	        driver.findElement(By.xpath("//form[@id='login_form']/table/tbody/tr[2]/td[3]/label/input")).click();
	 
	        // Print a Log In message to the screen
	        System.out.println(" Login Successfully.");
	 
	        // Close the driver
	        driver.quit();
	}
}



hardlovebee21
Fresher Tester
Posts: 18
Joined: Fri 05 Apr, 2013 4:04 pm
Contact:

Re: Lỗi khi chạy example đầu tiên về selenium webdriver

Post by hardlovebee21 » Thu 18 Aug, 2016 11:13 am

Mình đọc trong bài này:https://www.seleniumeasy.com/selenium-t ... -webdriver
Sau đó Update lại version firefox là 46 mà vẫn bị lỗi



tvn
Admin
Posts: 4738
Joined: Tue 10 Aug, 2010 10:11 am
Location: HCM
Contact:

Re: Lỗi khi chạy example đầu tiên về selenium webdriver

Post by tvn » Thu 18 Aug, 2016 11:59 pm

Bạn vui lòng join group chat Skype này (TVN Selenium) để được hướng dẫn nha. Hoặc add nick hoangliensonmt, rồi mình sẽ add bạn vào group đó.

https://join.skype.com/I8bP0FBmDjDn



Post Reply

Return to “Selenium”