2

今日まで完全に機能するコードがありました。

  public class TestSelenium {


    public static void main(String[] args) {


                System.setProperty("webdriver.chrome.driver","chromedriver\\chromedriver.exe"); 
                WebDriver driver = new ChromeDriver();
                driver.get("https://google.com");
                driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
                driver.findElement(By.name("q")).sendKeys("hello world");

    }

}

上記の単純なコードでは、次のエラーが発生します。

  Started ChromeDriver
port=25456
version=26.0.1383.0
log=C:\Use................omedriver.log
Exception in thread "main" org.openqa.selenium.WebDriverException: Unknown command 'WaitForAllTabsToStopLoading'. Options: AcceptOrDismissAppModalDialog, ActionOnSSLBlockingPage, ActivateTab, AddBookmark, AddDomEventObserver, AppendTab, ApplyAccelerator, BringBrowserToFront, ClearEventQueue, CloseBrowserWindow, CloseTab, CreateNewAutomationProvider, DeleteCookie, DeleteCookieInBrowserContext, DoesAutomationObjectExist, DragAndDropFilePaths, ExecuteJavascript, ExecuteJavascriptInRenderView, GetActiveTabIndex, GetAppModalDialogMessage, GetBookmarkBarStatus, GetBookmarksAsJSON, GetBrowserInfo, GetBrowserWindowCount, GetChromeDriverAutomationVersion, GetCookies, GetCookiesInBrowserContext, GetDownloadDirectory, GetExtensionsInfo, GetIndicesFromTab, GetLocalStatePrefsInfo, GetMultiProfileInfo, GetNextEvent, GetPrefsInfo, GetProcessInfo, GetSecurityState, GetTabCount, GetTabIds, GetTabInfo, GetViews, GoBack, GoForward, InstallExtension, IsDownloadShelfVisible, IsFindInPageVisible, IsMenuCommandEnabled, IsPageActionVisible, IsTabIdValid, MaximizeView, NavigateToURL, OpenFindInPage, OpenNewBrowserWindow, OpenNewBrowserWindowWithNewProfile, OpenProfileWindow, OverrideGeoposition, RefreshPolicies, Reload, RemoveBookmark, RemoveEventObserver, ReparentBookmark, RunCommand, SendWebkitKeyEvent, SetBookmarkTitle, SetBookmarkURL, SetCookie, SetCookieInBrowserContext, SetDownloadShelfVisible, SetExtensionStateById, SetLocalStatePrefs, SetPrefs, SetViewBounds, SimulateAsanMemoryBug, TriggerBrowserActionById, TriggerPageActionById, UninstallExtensionById, UpdateExtensionsNow, WaitForBookmarkModelToLoad, WaitUntilNavigationCompletes, WebkitMouseButtonDown, WebkitMouseButtonUp, WebkitMouseClick, WebkitMouseDoubleClick, WebkitMouseDrag, WebkitMouseMove, AcceptCurrentFullscreenOrMouseLockRequest, AddOrEditSearchEngine, AddSavedPassword, CloseNotification, DenyCurrentFullscreenOrMouseLockRequest, DisablePlugin, EnablePlugin, FindInPage, GetAllNotifications, GetDownloadsInfo, GetFPS, GetHistoryInfo, GetInitialLoadTimes, GetNTPInfo, GetNavigationInfo, GetOmniboxInfo, GetPluginsInfo, GetSavedPasswords, GetSearchEngineInfo, GetV8HeapStats, ImportSettings, IsFullscreenBubbleDisplayed, IsFullscreenBubbleDisplayingButtons, IsFullscreenForBrowser, IsFullscreenForTab, IsFullscreenPermissionRequested, IsMouseLockPermissionRequested, IsMouseLocked, KillRendererProcess, LaunchApp, LoadSearchEngineInfo, OmniboxAcceptInput, OmniboxMovePopupSelection, PerformActionOnDownload, PerformActionOnInfobar, PerformActionOnSearchEngine, RemoveNTPMostVisitedThumbnail, RemoveSavedPassword, RestoreAllNTPMostVisitedThumbnails, SaveTabContents, SetAppLaunchType, SetOmniboxText, SetWindowDimensions, WaitForAllDownloadsToComplete, WaitForNotificationCount,  (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 52 milliseconds
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 20:21:18'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_11'
Session ID: 987719ad2795cc183f7dba
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, chrome.chromedriverVersion=26.0.1383.0, acceptSslCerts=false, javascriptEnabled=true, browserName=chrome, rotatable=false, locationContextEnabled=false, version=29.0.1547.57, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, applicationCacheEnabled=false, takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:533)
    at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:276)
    at genealogy2.TestSelenium.main(TestSelenium.java:21)

私は非常に混乱しています... の何が問題になっていFluent waitますか? Selenium に何か変更がありましたか、それとも Java の自動アップグレードが原因でこの種のエラーが発生した可能性はありますか? (PS: Java と Selenium を手動でアップグレードしませんでした) ChromeDriver をアップグレードする必要がありますか? 最新バージョンを検索しようとしましたが、私が使用しているものよりも新しいものは見つかりませんでした

また、私は次のことを試しました:

public class TestSelenium {


    public static void main(String[] args) {


                WebDriver driver = new HtmlUnitDriver();
                driver.get("https://google.com");
                driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
                driver.findElement(By.name("q")).sendKeys("hello world");
                System.out.println("hi");
    }

}

上記のコードは正常に動作します...つまり、問題は chrome ドライバーにあるということですか?

4

1 に答える 1