Sendkeys not working. Please help me to resolve this..
WebElement username = driver.findElement(By.xpath("//*[#id='username']"));
username.sendKeys("123456");
Console:
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.31)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.1.7601 SP1 x86)
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: 'NEW-PC', ip: '192.168.0.103', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_161'
Driver info:
org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptSslCerts: true, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.33.506120 (e3e53437346286..., userDataDir: C:\Users\NEW\AppData\Local\...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 65.0.3325.31, webStorageEnabled: true}
I was seeing the same issue. The problem only appears when using Chrome 65 (currently: dev channel). With Chrome 64 (both stable channel and beta channel) everything worked fine.
It turns out I had an old chromedriver installed. Specifically, I was using chrome=65.0.3325.51 with chromedriver=2.29.461585. Running npm install -g chromedriver bumped chromedriver to 2.35.528157 and now the problem is solved.
TL;DR: run npm install -g chromedriver
The error says it all :
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.31)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.1.7601 SP1 x86)
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
Your main issue is the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.33
Release Notes of chromedriver=2.33 clearly mentions the following :
Supports Chrome v60-62
You are using chrome=65.0
Release Notes of ChromeDriver v2.37 clearly mentions the following :
Supports Chrome v64-66
So there is a clear mismatch between the ChromeDriver version (v2.33) and the Chrome Browser version (v65.0)
Solution
Upgrade ChromeDriver to current ChromeDriver v2.37 level.
Keep Chrome version at Chrome v65.x levels. (as per ChromeDriver v2.37 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Execute your #Test.
The latest chrome browser requires corresponding latest chromedriver executable for the tests to run.
I have encountered the same issue and installed the chrome drive. Issue got resolved.
npm install chromedriver --chromedriver_version=LATEST
Changing latest version of ChromDriver worked for me.
You may need to update you driver the link for all the chromedriver updates are http://chromedriver.storage.googleapis.com/index.html
make sure you chromedriver corresponds to your version of chrome
I simply installed a new version of Katalon Studio and it has worked fine.
This issue happens when chrome and chromedriver are not in sync. Either update both to the latest version or make sure they can work together. After running the following commands it worked for me
npm install -g chromedriver --chromedriver-force-download
webdriver-manager update
Related
I have the package reference set as
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="*" />
However tests are failing in AppVeyor throwing this error:
System.InvalidOperationException : session not created: This version of ChromeDriver only supports Chrome version 100
Current browser version is 99.0.4844.84 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe (SessionNotCreated)
Shouldn't the asterisk be downloading the latest version on each AppVeyor run?
Try using *-*. Using * only takes into account release versions.
Reference:
https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#floating-version-resolutions
Chrome have pushed the version to 100 just now.
Update your browser (incase not auto updated), you will be good to go.
I am using C# Selenium for automated testing, and after the most recent chromedriver update 89.0.4389.2300, Google chrome starts and crashes right away. The weirdest thing is that when I am running it on my local, everything works fine, but I am also using Azure pipelines to run my tests on a server. The server one gives me this:
OpenQA.Selenium.WebDriverException : unknown error: Chrome failed to start: crashed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
I have googled around and tried things like adding chromeOptions.AddArgument("--no-sandbox") and chromeOptions.AddArguments("disable-dev-shm-usage") but nothing helps. Chrome on my server is updated to the correct version too. The tests run headless.
Anyone else is having this issue?
The error mentions that chromedriver could not bind to open debug port on running Chrome.
Possible cases I met with:
old version of Chrome browser or chromedriver - since some version the port has changed
wrong Chrome binary location (chromedriver is looking for C:\Program Files (x86)\Google\Chrome\Application\chrome.exe)
My Chrome browser is updated to version 78 and when I tried to execute any code of automation, it shows the error
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1573451703.668][WARNING]: Timed out connecting to Chrome, retrying...
Nov 11, 2019 11:25:05 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[1573451709.039][WARNING]: Timed out connecting to Chrome, retrying...
How can I fix it?
This error message...
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1573451703.668][WARNING]: Timed out connecting to Chrome, retrying...
Nov 11, 2019 11:25:05 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[1573451709.039][WARNING]: Timed out connecting to Chrome, retrying...
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Analysis
The first log message:
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
is part of the startup log when using ChromeDriver and is informative in nature.
You can find a detailed discussion in How do I protect the ports that chromedriver use?
The following log message:
[1573451703.668][WARNING]: Timed out connecting to Chrome, retrying...
indicates there are some incompatibility between the version of the binaries you are using.
Solution
Ensure that:
JDK is upgraded to current levels JDK 8u222.
Selenium is upgraded to current levels Version 3.141.59.
ChromeDriver is updated to current ChromeDriver v78.0 level.
Chrome is updated to current Chrome Version 78.0 level. (as per ChromeDriver v78.0 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
(WindowsOS only) Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
(LinuxOS only) Free Up and Release the Unused/Cached Memory in Ubuntu/Linux Mint before and after the execution of your Test Suite.
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.
I have fixed this issue of timeout / Connection reset by changing my code from:
public void AfterScenario(Scenario sc) {
driver.close();
driver.quit();
driver = null;
}
to:
public void AfterScenario(Scenario sc) {
driver.quit();
driver = null;
}
So basically I removed the driver.close() and this fixed my issue. I do not know why this is happening, but experts can explain more...
I had to update to the dev version of chrome 79 and the latest dev version of chromedriver to make it work. Although I've run against other issues with this version, so I don't know if its a good solution.
I'd like to run an Appium server with default settings from C# like that:
AppiumLocalService appiumLocalService = AppiumLocalService.BuildDefaultService();
appiumLocalService.Start();
I also set the environment variables right before that:
Environment.SetEnvironmentVariable(AppiumServiceConstants.NodeBinaryPath, #"C:\Program Files\nodejs\node.exe");
Environment.SetEnvironmentVariable(AppiumServiceConstants.AppiumBinaryPath,#"C:\Program Files (x86)\Appium\resources\app\node_modules\appium\lib\main.js"
When I am trying to run the code is stopping for 2 minutes, and I get the following exception:
Message: OpenQA.Selenium.Appium.Service.Exceptions.AppiumServerHasNotBeenStartedLocallyException : The local appium server has not been started. The given Node.js executable: C:\Program Files\nodejs\node.exe Arguments: "C:\Program Files (x86)\Appium\resources\app\node_modules\appium\lib\main.js" --port 4723 --address 127.0.0.1.
Time 120000 ms for the service starting has been expired!
I Googled a lot, but I couldn't find the answer for that. I can start Appium manually from console or from Desktop Application without any problem.
Appium Dotnet version: 3.0.0.2
Appium version: 1.11.1
Node.js version: v10.15.1
I appreciate any suggestion/help.
SOLVED:
wrong:
Environment.SetEnvironmentVariable(AppiumServiceConstants.AppiumBinaryPath,#"C:\Program Files (x86)\Appium\resources\app\node_modules\appium\lib\main.js"
Right:
Environment.SetEnvironmentVariable(AppiumServiceConstants.AppiumBinaryPath,#"C:\Program Files (x86)\Appium\resources\app\node_modules\appium\***build***\lib\main.js"
So basicly the last directory is wrong in the path.
I solved my problem as well adding the right path to the PATH variable.
C:\>npm config get prefix
add the prefix to system environment path
Restart
reinstall node.js to the latest version (typical installer)
reinstall appium (by npm install -g appium)
verify appium is able to run with the command: appium
I am getting the following error when running my tests via teamcity. I am trying to fire up chrome and run tests on a build agent which is a windows server 2008 machine. When the tests are run, multiple instances of chromedriver are fired up (i can see them in task manager) which eventually maxes out CPU/Memory. The browser is not started at all. I then get tests failing with the below error:
System.InvalidOperationException: unknown error: version info not a dictionary
(Driver info: chromedriver=2.7.236900,platform=Windows NT 6.1 SP1 x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 1012
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 846
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 814
My setup looks like this:
var options = new ChromeOptions();
options.AddArgument("--start-maximized");
_driver = new ChromeDriver(#"C:\chromedriver", options);
I have looked around for solutions and people have generally got it to work by updating Chrome and chrome driver. I updated my setup to be the below but i still get the same issue
I am using Chrome version 29
Chromedriver version 2.7 and have also tried 2.8
My .Net binding are version 2.3.3
Specflow version 1.91
Works absolutely fine on my local machine though.
Try stopping all the build agent services then start the build agent from the bat file in the teamcity buildagent folder. Then run the tests and see if that works. If it works I tell you how to set it up like my teamcity server (my chrome driver works).