2017-05-12 8 views
0

私はMozilla 51.0.1とEclipse Lunar 3.0.1を使用しています。コードを実行しようとしているときに、ブラウザでURLを取得できません。ただ開くだけです。selenium webdriverでmozillaでURLを取得できません

package SessionPack; 

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

public class SessionCalss { 

    public static void main(String arg[]) 
    { 
     System.out.println("String"); 

     WebDriver driver; 

     System.setProperty("webdriver.gecko.driver", "C:\\New folder\\geckodriver.exe"); 
     driver=new FirefoxDriver(); 

     driver.get("www.gooogle.com"); 

    } 
} 
+0

コンソールには何がありますか? –

+0

あなたが使用しているSeleniumとGeckoのバージョンは何ですか?そして、あなたが得ているエラーメッセージは何ですか? –

答えて

0

あなたは、具体的http://またはhttps://を指定する必要があります。あなたからあなたのURL文字列を変更する必要があります。

www.gooogle.com to https://www.gooogle.com 
2

あなたの要求は、2つの場所で間違っている:

  1. あなたは「o」は、余分な文字を書く - gooogle
  2. あなたがしなければならないURL - 前https://を追加しましたアドレス - https://www.google.com

このコードを修正すると動作します。

関連する問題