2016-11-23 5 views
1

私は過去数時間この問題に苦労しています。私はSelenium Webドライバをインストールしようとしており、テストページを実行できないようなエラーが発生しています。私は、最近の問題がこのコードであることを確信しています。ドライバ実行ファイルが存在しません:Selenium Firefox

public static void main(String[] args) throws InterruptedException{ 
     System.setProperty("webdriver.gecko.driver","C:/Users/theone/Downloads/geckodriver 2.exe"); 

本当に2番目のステップでフィードバックがありますか?

package automationFramework; 

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

public class FirstTestCase { 

    public static void main(String[] args) throws InterruptedException{ 
     System.setProperty("webdriver.gecko.driver","C:/Users/theone/Downloads/geckodriver 2.exe"); 

     // Create a new instance of the Firefox driver 
     WebDriver driver = new FirefoxDriver(); 

     //Launch the Online Store Website 
     driver.get("http://www.store.demoqa.com"); 

     // Print a Log In message to the screen 
     System.out.println("Successfully opened the website www.Store.Demoqa.com"); 

     //Wait for 5 Sec 
     Thread.sleep(5); 

     // Close the driver 
     driver.quit(); 
    } 
} 

答えて

3
C:/Users/theone/Downloads/geckodriver 2.exe 

パスにスペースがあり、それは可能だ - それは、Firefox、GeckoDriverとSelenium 3.0

チェックアウトこれらの方法の両方を使用してセットアップを提供し、この記事のあなたの場合は、最新バージョンが良いでしょうファイルの名前を変更すると動作しますgeckodriver2.exe

+0

ありがとうございます!出来た! –

+1

@RanaHaram - この回答があなたの問題を解決するために働いた場合は、正解としてそ​​れを受け入れてください – bakoyaro

関連する問題