cannot run Selenium tests on some browsers - google-chrome

i have tests made with Mink using Selenium 2 driver. everything is working OK under Windows 7 with Firefox, Chrome and IE and Ubuntu 12.10 with Firefox. the problems are:
when i try to run test on Opera (Windows 7) it launches but it cannot find any element on the page - the test fails.
when i try to run test on Chrome (Ubuntu 12.10) using chromedriver - the system returns an error "An unknows server side error occured while processing the command".
when i try to run test on Opera (Ubuntu 12.10) - the system returns an error "No response in timely fashion".
what am i doing wrong? how can i make work Opera in Windows and Opera and Chrome in Ubuntu?
p.s. i use system as Selenium Grid 2

For me on Windows it work:
java -jar "c:\selenium-server-standalone-2.35.0.jar" -forcedBrowserMode "*googlechrome c:\Program Files\Google\Chrome\Application\chrome.exe"
May be for u:
java -jar "c:\selenium-server-standalone-2.35.0.jar" -forcedBrowserMode "*opera c:\Program Files\pathToOpera.exe"

It might be a matter of Operative System as well.
I am developing on a Windows machine and my colleagues are working on Mac.
They had just included the chrome driver for mac, so tests didntĀ“t work on my computer.
I had to do this:
if (OS.indexOf("win") >= 0) {
System.setProperty("webdriver.chrome.driver", "src/test/resources/selenium_drivers/chromedriver.exe");
} else if ((OS.indexOf("mac") >= 0)) {
System.setProperty("webdriver.chrome.driver", "src/test/resources/selenium_drivers/chromedriver");
}
Two different driversa that you can find at http://chromedriver.storage.googleapis.com/index.html

Related

Downgrade chromedriver version during runtime using webdrivermanager

Problem:
Facing an issue to downgrade chrome driver version during runtime.
Background:
Using chrome + Docan(needs chrome driver with v2.33) to do automation test of an application.
First, start chrome with driver version: 91.0.4472.124.
Then, switch to Docan which needs chrome driver with version 2.33.
Code:
WebDriverManager webDriverManager = null;
Initial:
webDriverManager = WebDriverManager.chromedriver();
Switch:
WebDriverManager.chromedriver().clearResolutionCache();
webDriverManager = WebDriverManager.chromedriver().driverVersion("2.33");
webdriver.avoidBrowserDetection();
Behavior:
After switch:
System.getProperty("webdriver.chrome.driver") --> return path for version 2.33
In log:
I could see chromedriver version is still 91
UI action:
Docan is not fully supported for actions like click.(It supports fine if driver is 2.33, tried with IE + Docan)
Is there any suggestion to make it work?

WebdriverIO - Test fails with error Openfin

I have been trying to setup automation testing for our openfin application using the below repo as base
https://github.com/openfin/webinar-automated-integration-tests
I am using Openfin (Chrome version 61.0.3163.100) and Chromedriver 2.40.565498
When I run "npm test", the openfin application opens up. But the tests don't run. After waiting for sometime, it throws the below error in console.
ERROR: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.16299 x86_64)
chrome
I tried using other versions of chromedriver like 2.33, 2.34, 2.37, 2.38, 2.39, 2.41. Using these versions even the application doesn't appear. So, I guess the chromedriver version I am using is correct. I have also tried adding the below arguments to chromeOptions
--remote-debugging-port=9222,--no-sandbox,--headless,--disable-gpu
They didn't solve my issue. Not sure what is causing the issue. Any help would be much appreciated. Thanks in advance. Cheers!
This error message...
ERROR: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.16299 x86_64)
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.40
Release Notes of chromedriver=2.40 clearly mentions the following :
Supports Chrome v66-68
Presumably you are using chrome=61.0
Release Notes of ChromeDriver v2.33 clearly mentions the following :
Supports Chrome 60-62
Your Selenium Client version is unknown to us.
So there is a clear mismatch between ChromeDriver v2.40 and the Chrome Browser v60.0
Solution
Ensure that:
Selenium is upgraded to current levels Version 3.141.59.
ChromeDriver is updated to current ChromeDriver v80.0 level.
Chrome is updated to current Chrome Version 80.0 level. (as per ChromeDriver v80.0 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test as non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

Coded UI doesn't launch testing in Chrome

I have a hand written coded ui test with about 120 test cases. It is working well with IE but I want to run in chrome (or in Edge). I have installed the Cross Browser Selenium components with the chromedriver. After the installation I have changed my code with BrowserWindow.CurrentBrowser = "chrome"; line.
Actually it launches the chrome (68.0.3440.75) but then it fails with this exception :
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: A
exception with a null response was thrown sending an HTTP request to
the remote WebDriver server for URL
http://localhost:4334/session/74ce571a635c376d0982b7f59dc31f3b/title.
The status of the exception was ConnectFailure, and the message was:
Unable to connect to the remote server.
The chromedriver is 2.25 which I know it's not compatible with my chrome, but If I upgrade the chromedriver with the latest version, then it launches and immediately closes itself.
Any suggestions?

Google chrome 29.0 is not working with webdriver

I was trying to load google chrome browser with watir-webdriver, but while invoking any URL in the browser it is throwing following error
Selenium::WebDriver::Error::UnknownError: Unknown command 'WaitForAllTabsToStopL
oading'. Options: AcceptOrDismissAppModalDialog, ActionOnSSLBlockingPage, Activa
teTab, AddBookmark, AddDomEventObserver, AppendTab, ApplyAccelerator, BringBrows
erToFront, ClearEventQueue, CloseBrowserWindow, CloseTab, CreateNewAutomationPro
vider, DeleteCookie, DeleteCookieInBrowserContext, DoesAutomationObjectExist, Dr
agAndDropFilePaths, ExecuteJavascript, ExecuteJavascriptInRenderView, GetActiveT
abIndex, GetAppModalDialogMessage, GetBookmarkBarStatus, GetBookmarksAsJSON, Get
BrowserInfo, GetBrowserWindowCount, GetChromeDriverAutomationVersion, GetCookies
, GetCookiesInBrowserContext, GetDownloadDirectory, GetExtensionsInfo, GetIndice
sFromTab, GetLocalStatePrefsInfo, GetMultiProfileInfo, GetNextEvent, GetPrefsInf
o, GetProcessInfo, GetSecurityState, GetTabCount, GetTabIds, GetTabInfo, GetView
s, GoBack, GoForward, InstallExtension, IsDownloadShelfVisible, IsFindInPageVisi
ble, IsMenuCommandEnabled, IsPageActionVisible, IsTabIdValid, MaximizeView, Navi
gateToURL, OpenFindInPage, OpenNewBrowserWindow, OpenNewBrowserWindowWithNewProf
ile, OpenProfileWindow, OverrideGeoposition, RefreshPolicies, Reload, RemoveBook
mark, RemoveEventObserver, ReparentBookmark, RunCommand, SendWebkitKeyEvent, Set
BookmarkTitle, SetBookmarkURL, SetCookie, SetCookieInBrowserContext, SetDownload
ShelfVisible, SetExtensionStateById, SetLocalStatePrefs, SetPrefs, SetViewBounds
, SimulateAsanMemoryBug, TriggerBrowserActionById, TriggerPageActionById, Uninst
allExtensionById, UpdateExtensionsNow, WaitForBookmarkModelToLoad, WaitUntilNavi
gationCompletes, WebkitMouseButtonDown, WebkitMouseButtonUp, WebkitMouseClick, W
ebkitMouseDoubleClick, WebkitMouseDrag, WebkitMouseMove, AcceptCurrentFullscreen
OrMouseLockRequest, AddOrEditSearchEngine, AddSavedPassword, CloseNotification,
DenyCurrentFullscreenOrMouseLockRequest, DisablePlugin, EnablePlugin, FindInPage
, GetAllNotifications, GetDownloadsInfo, GetFPS, GetHistoryInfo, GetInitialLoadT
imes, GetNTPInfo, GetNavigationInfo, GetOmniboxInfo, GetPluginsInfo, GetSavedPas
swords, GetSearchEngineInfo, GetV8HeapStats, ImportSettings, IsFullscreenBubbleD
isplayed, IsFullscreenBubbleDisplayingButtons, IsFullscreenForBrowser, IsFullscr
eenForTab, IsFullscreenPermissionRequested, IsMouseLockPermissionRequested, IsMo
useLocked, KillRendererProcess, LaunchApp, LoadSearchEngineInfo, OmniboxAcceptIn
put, OmniboxMovePopupSelection, PerformActionOnDownload, PerformActionOnInfobar,
PerformActionOnSearchEngine, RemoveNTPMostVisitedThumbnail, RemoveSavedPassword
, RestoreAllNTPMostVisitedThumbnails, SaveTabContents, SetAppLaunchType, SetOmni
boxText, SetWindowDimensions, WaitForAllDownloadsToComplete, WaitForNotification
Count,
It might be throwing this error because of Chrome update where as webdriver is not supporting the updated API's,
I also tried to update watir-webdriver gem, but it is saying nothing to update (its up to date) My watir-webdriver version is watir-webdriver-0.6.4
Kindly let me know if any one else is facing the same issue or any one found out the solution for the same.
Gaurav, I've had the same issue.
Here are the steps how i fixed this:
1. Remove old the versions (ruby, watir, devkit)
2. Install to Ruby 2.0.0-p195
3. Install devkit
4. Add latest chromedriver to your $PATH
5. gem install watir-webdriver
6. gem update --system
7. gem update
8. gem cleanup
Also update the chromedriver executable to the latest version (and double check it in your path).
I have: ruby 2.0.0p195 (2013-05-14) [i386-mingw32] && watir-webdriver(0.6.4)
Voila:
C:\Ruby200\bin>irb
irb(main):001:0> require "watir-webdriver"
=> true
irb(main):002:0> b = Watir::Browser.new :chrome
Starting ChromeDriver (v2.2) on port 9515
=> #<Watir::Browser:0x3cac37de url="data:text/html;charset=utf-8," title="data:t
ext/html;charset=utf-8,">
irb(main):003:0> b.goto "stackoverflow.com"
=> "http://stackoverflow.com/"
irb(main):004:0> b.inspect
=> "#<Watir::Browser:0x50eee9c0 url=\"http://stackoverflow.com/\" title=\"Stack
Overflow\">"
Please let me know if it helped.
I am also facing the same issue. I am getting this error exactly when I am trying to navigate to driver.goto("google.com").
But if I revert my Chrome version from 29 to 27 then its working fine. So I think the issue is from chrome version 29 or chrome driver version chromedriver_win32_2.2.zip
So please downgrade the chrome temporarily....
Download the latest version of chromedriver. Also make sure that the old old on NOT in your PATH.
Did you upgrade to the latest version of selenium-webdriver?
gem install selenium-webdriver
Remember that watir-webdriver is just a wrapper around selenium-webdriver. It is actually selenium-webdriver that does the interaction with chromedriver. Typically, when there is an update to chromedriver, there also needs to be an update to selenium-webdriver.
There were 2 updates to selenium-webdriver since the latest chromedriver update. It is possible that one of the updates addressed your issue.
Use the Latest jar file of selenium web driver- selenium-server-standalone-2.35.0.jar
and chromedriver_win32_2.3.zip for chrome driver.
I have seen this issue and we fixed it by moving to ChromeDriver 2.3 in both Mac and Windows
Versions I use:
Ruby version: 1.9.3-p194
Watir-webdriver version: 0.6.4
Selenium-webdriver version: 2.33.0
if you can make sure chrome driver is in the PATH, this should work. No need to upgrade to ruby 2.0.
You would use capabilities to point to the right binary file of the browser to be launced.But not all versions of chrome browser is supported by different versions of chromedriver. You will find exceptions stating that version of browser expected is greater or equal to 30.0.
For ex:- Chromium Browser(33.0.1729.0 )works fine with ChromeDriver 2.7 and not the with the older ones.
You can choose from all the chromedriver version available from the link below:- http://chromedriver.storage.googleapis.com/index.html
So try to use the browser version supported by the chromedriver.

Error using ChromeDriver when kicked off from teamcity

I was having trouble with firefox for my watir-webdriver tests and decided to move over to CHROME. This runs fine local dev box, however when kicked off from team city on our qa server I get the following error:
This is using the same chromedriver as on dev box.
Windows 2003 Server 32 bit
Chrome 14.0.835.186
chromedriver_win32_14.0.836.0.zip ChromeDriver server for win32
Ruby 1.8.7
watir-webdriver 0.3.4
selenium-webdriver 2.7.0
watir-page-helper 0.3.0
Error
[15:57:06]: Started ChromeDriver
[15:57:06]: port=1203
[15:57:31]: .\test\automation\proxy_launcher.cc(89): error: Value of: app_launched
[15:57:31]: Actual: 1
[15:57:31]: Expected: AUTOMATION_SUCCESS
[15:57:31]: Which is: 0
[15:57:31]: Error while awaiting automation ping from browser process
[15:57:56]: .\test\automation\proxy_launcher.cc(223): error: Value of: automation()->GetBrowserWindowCount(&window_count)
[15:57:56]: Actual: false
[15:57:56]: Expected: true
I believe your problem is you're running the TeamCity agent as a service, try manually running the agent using the instructions on: http://confluence.jetbrains.net/display/TCD5/Setting+up+and+Running+Additional+Build+Agents#SettingupandRunningAdditionalBuildAgents-StartingtheBuildAgent
I'm not using TeamCity or Watir, but I had the same error message from webdriver (using selenium server) running under a windows service.
The solution that worked for me was to run the service under another account and not the system account. Might be worth a try?