2017-01-07 97 views
0

說明:未能找到值字段

雖然執行Java腳本代碼來顯示警報,我得到「無法找到值字段」在第二行異常。

代碼:

 IJavaScriptExecutor js = driver as IJavaScriptExecutor;  
     js.ExecuteScript("alert('Complete human verification.')");  
     Thread.Sleep(30000); 

例外:

System.InvalidOperationException was unhandled by user code 
    HResult=-2146233079 
    Message=Failed to find value field 
    Source=WebDriver 
    StackTrace: 
     at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 1268 
     at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 1070 
     at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 1154 
     at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript(String script, Object[] args) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 520 
     at Projects.AnimeList.HumanAlert() in c:\Users\Yudhaamanyu\Documents\Visual Studio 2013\Projects\UnitTestProject2\Projects\PageActions\AnimeList.cs:line 63 
     at Projects.AnimeList.CopyAllEpisodeUrls() in c:\Users\Yudhaamanyu\Documents\Visual Studio 2013\Projects\UnitTestProject2\Projects\PageActions\AnimeList.cs:line 26 
     at SeleniumPractice.KAScripts.KAScripts.DownloadAnimeUrls() in c:\Users\Yudhaamanyu\Documents\Visual Studio 2013\Projects\UnitTestProject2\SeleniumPractice\Scripts\KAScripts.cs:line 27 
    InnerException: 

回答

-1

我有這個問題。 您有解決方案嗎?

+0

這似乎是一個geckodriver錯誤,並沒有解決這個問題。 – Black