2017-04-14 9 views
0

ブラウザが開きますが、Not secureがヘッダーに表示されていて、[拡張機能を無効にする]が表示されています。その後、chrome.exeは動作を停止します。 クロームverisonは57.0で、セレンのjarファイルは、まず最初に、あなたが自動化のために使用されているChromeのドライバを更新することである3.0.1セレンからChromeブラウザを開くときにエラーが発生する

public static void main(String[] args) throws InterruptedException 
{ 

    System.setProperty("webdriver.gecko.driver","E:\\Software\\geckodriver-v0.14.0-win64\\geckodriver.exe"); 
    //WebDriver wd= new FirefoxDriver(); 

    System.setProperty("webdriver.chrome.driver","E:\\Software\\chromedriver_win32_V2.9\\chromedriver.exe"); 

    ChromeOptions options = new ChromeOptions(); 
    options.addArguments("--disable-extensions"); 
    WebDriver wd= new ChromeDriver(); 


    wd.get("http://automationpractice.com/index.php"); 
} 
+0

ご覧いただいているエラーは何ですか? – DebanjanB

+0

質問をスタックトレースで更新できますか? – DebanjanB

答えて

0

です。これは2.28バージョンとすることができ、これらのコード行で試してください。

DesiredCapabilities capabilities = new DesiredCapabilities(); 
capabilities = DesiredCapabilities.chrome(); 
ChromeOptions options = new ChromeOptions(); 
Map<String, Object> prefs = new HashMap<String, Object>(); 
prefs.put("credentials_enable_service", false); 
prefs.put("profile.password_manager_enabled", false); 
options.setExperimentalOption("prefs", prefs); 
options.addArguments("--disable-extensions"); 
capabilities.setCapability(ChromeOptions.CAPABILITY, options); 
System.setProperty("webdriver.chrome.driver", chromepath); 
WebDriver driver = new ChromeDriver(capabilities); 

問題がある場合はお知らせください。

+0

私はクロムドライバーのバージョン2.9と2.8でそれをチェックしましたが、組織はまだ消えています。添付リンクhttps://i.stack.imgur.com/ve4ub.pngを見つけてください。Firefoxのブラウザで同じことを試してみたら、「movetoは既知のコマンドと一致しませんでした」と表示されます。 –

0

あなたのコードでは、chromeオプションを作成しましたが、chromeドライバをインスタンス化している間にそのオプションはインクルードしていません。

System.setProperty("webdriver.chrome.driver","E:\\Software\\chromedriver_win32_V2.9\\chromedriver.exe"); 
ChromeOptions options = new ChromeOptions(); 
options.addArguments("--disable-extensions"); 
options.addArguments("test-type"); 

クロームドライバにオプションを含めるのを忘れた、以下の修正があります。クロームドライバのドキュメントを1として

driver = new ChromeDriver(options); 

OR

以下の機能がコードであるようなオプションを設定します。

DesiredCapabilities caps = DesiredCapabilities.chrome(); 
ChromeOptions options = new ChromeOptions(); 
options.addArguments("--disable-extensions"); 
options.addArguments("test-type"); 
caps.setCapability(ChromeOptions.CAPABILITY, options); 
driver = new ChromeDriver(caps); 

問題が解決した場合はお知らせください。セレン3.xので

+0

ドライバ=新しいChromeDriver(オプション);拡張機能を無効にするのに役立ちます。まだGoogle Chromeで「安全でないデータ」が表示されています。リンクhttps://i.stack.imgur.com/ve4ub.png –

+0

を見つけてください。Firefoxのブラウザで同じことを試してみたら、「movetoは既知のコマンドと一致しませんでした」と表示されます。 –

+0

クロムブラウザの回答が更新されました。一度確認してください。 – Akarsh

0

、クロムドライバ2.28 &上記とGoogle Chromeの57.xは、以下のようにすべての依存関係を取り除くためにするChromeOptionsクラスを使用します。

ChromeOptions options = new ChromeOptions(); 
    options.addArguments("--disable-extensions"); 
    options.addArguments("--disable-notifications"); 
    options.addArguments("--enable-automation"); 
    options.addArguments("--disable-save-password-bubble"); 
    options.addArguments("test-type"); 
    options.addArguments("start-maximized"); 
    options.addArguments("test-type=browser"); 
    options.addArguments("disable-infobars"); 
    DesiredCapabilities capabilities = DesiredCapabilities.chrome(); 
    capabilities.setCapability(ChromeOptions.CAPABILITY, options); 
    WebDriver driver = new ChromeDriver(capabilities); 

これはあなたのために働くなら、私を知ってみましょう。

+0

同じエラーが発生しています。クロームドライバの問題以外に、どうすればFirefoxのドライバの問題を解決できますか? –

+0

エラートレース スレッド "main"の例外org.openqa.selenium.WebDriverException:不明なエラー:Runtime.executionContextCreated has invalid 'context':{"auxData":{"frameId": "5572.1"、 "isDefault":true }、 "id":1、 "name": ""、 "origin": "://"} (セッション情報:chrome = 57.0.2987.133) (ドライバ情報:chromedriver = 2.8.241075、platform = Windows NT 6.1 SP1 x86_64)(警告:サーバはスタックトレース情報を提供しませんでした) コマンドの継続時間またはタイムアウト:16ミリ秒 ビルドインフォメーション:バージョン: '3.0.1'、リビジョン: '1969d75'、時刻: '2016-10- 18 09:48:19 -0700 ' –

+0

@AbhijitDatta私が提供したコードは、あなたが添付ファイルを提供していたあなたが観察していた証明書の問題を処理することです。私はあなたがこれらの警告をもう見ないと確信しています。 Firefoxのドライバの問題とWebDriverExceptionを解決するには、別のスレッドで対処します。だからこの答えがあなたの質問に答えるならば、ディスカッションスレッドを閉じるあなたの質問への答えとして答えを受け入れることができますか?ありがとう。 – DebanjanB

関連する問題