2016-05-18 3 views
0

私がテストしているのと同じシステム上でプロジェクトファイルを実行しています 私はselenium web driverとeclipseを使用しています私はログインページをテストするためのセレンスクリプトを実行すると、プロジェクトをテストするためのエラーが表示されます。Webアプリケーションをテストしようとすると、ローカルホストに接続できないというエラーが表示される

**error** : 

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: 
    l,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]}, 
"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1462864767739,"updateDate":1462864767739,"applyBackgroundUpdates":1,"skinnable":true,"size":22012,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":" 
{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"46.0.1","maxVersion":"46.0.1"}],"targetPlatforms":[],"seen":true} 

so after this i had set the proxy 
and tried but the result was same 
but when i tried to copy the link and manually pasted it in Mozilla and searched it was successfully showing the login page 

CODEセレン

パッケージTESTING

import org.openqa.selenium.By; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver; 

public class demo { 

    `public static void main(String[] args) { 
     WebDriver driver= new Firefox Driver(); 
     driver.get("localhost:8080/Chaitanya"); 
     driver.findElement(By.name("username")).send Keys("login"); 
     driver.findElement(By.name("login.password")).send Keys("password"); 
    ` 

答えて

0

あり、いくつかの誤植....

import org.openqa.selenium.By; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver; 

public class demo { 

    public static void main(String[] args) { 
     WebDriver driver= new FirefoxDriver(); 
     driver.get("http://localhost:8080/Chaitanya"); 
     driver.findElement(By.name("username")).sendKeys("login"); 
     driver.findElement(By.name("login.password")).sendKeys("password"); 
} 

それでも同じエラーが発生した場合。 Selenium Jarを最新版(http://www.seleniumhq.org/download/)に更新し、Firefoxブラウザを最新バージョンに更新してください。

+0

感謝の先生、問題解決に更新セレンジャーとFirefox –

+0

更新の矢印を上までクリックして、「完全な答えを使用」してくださいです... –

0

私は私の最近のプロジェクトで同じ問題を持っていた(FYI:問題がポートによって引き起こされる)、このための修正は次のとおりです。

、これはそれを修正する必要があり、セレンの最新バージョンを更新してください。そうでない場合は、このために周りの汚い仕事は

WebDriver driver;  
    try { 
    driver = new FirefoxDriver(); 
    } 
    catch(Exception e) { 
    driver = new FirefoxDriver(); 
    } 
関連する問題