Issue with chromedriver in RobotFramework - google-chrome

I started with python and Robot Framework.
I'm having this strange exception while trying to run a test case in Robot Framework.
WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: -1073741819
I tried changing the chromedriver versions, also checked the chrome browser it was updated to the last version.
I'm sure it's in it's place "Python27\Scripts" which is added to the environment variables as well.
Has anyone else had this issue, or know how to solve it?

Related

Chrome nativeMessaging example fails on Windows

I downloaded the official Chrome nativeMessaging example to test it out.
To do this, I installed the app from chrome://extensions, by choosing Load Unpacked. No problems so far.
I then installed the host. I'm using Windows 7, so I ran install_host.bat, which claimed that "The operation completed successfully." However, when I go to chrome://apps/ and click the Connect button, I get this error:
Failed to connect: Native host has exited.
Is there some reason this would happen? Restarting Chrome did not fix the issue, nor did uninstalling and then reinstalling the host program.
(I noticed that native-messaging-example-host.bat requires Python 2, so I modified it to run Python 2 explicitly. If I run native-messaging-example-host.bat from the command line, it pops up a little example program of its own with a GUI and seems to work correctly.)
Turns out I was using a non-standard character in the path leading to the host executable. This wouldn't be a problem for any other program, but Chrome's native messaging API doesn't like it, I guess.
By the way, the documentation on setting up this example is near-nonexistent, but this stack overflow link has some useful info: Chrome Extension NativeMessaging 'connectNative' undefined

Chrome headless not completing, ever (Windows)

I'm struggling to get Chrome headless to do absolutely anything.
I've tried the simple 'getting started' here: https://developers.google.com/web/updates/2017/04/headless-chrome
This example: chrome --headless --disable-gpu --screenshot https://www.chromestatus.com/
does nothing for me. No screenshot generated in the folder. (Was running CMD as Admin).
I've created a webapp (running in IIS on my PC) and set a breakpoint on its Index page. When I call the app using Chrome headless the breakpoint is triggered, but my 2nd (Console) app which created the Chrome headless instance never proceeds beyond the 'Navigate()' line.
The code from the console app:
IWebDriver webClient;
ChromeOptions option = new ChromeOptions();
option.AddArguments("--headless", "--disable-gpu", "--window-size=1920,1200", "--ignore-certificate-errors", "--no-sandbox");
webClient = new ChromeDriver(option);
webClient.Navigate().GoToUrl("http://localhost:49709/");
((ITakesScreenshot)webClient).GetScreenshot().SaveAsFile("ChromeScreenshot.png", ScreenshotImageFormat.Png);
Running:
Windows 7 64-bit
Chrome 64-bit 66.0.3359.139
ChromeDriver 2.38
What am I missing?
I've figured out what is causing the issue, but not why or a proper fix for it. Writing this here in case it helps someone in future.
I found by chance that a timeout error would eventually be thrown after 60 seconds:
The HTTP request to the remote WebDriver server for URL http://localhost:51660/session timed out after 60 seconds.
This error was being thrown on the creation of the ChromeDriver object. Note this is an error thrown by Selenium trying to communicate with the Chrome WebDriver, NOT the Navigate() command failing.
I discovered by complete chance that by removing the "--headless" parameter from the options makes everything works fine. I also found that another parameter "--remote-debugging-port=9222" causes it to fail completely, too.
I'm currently assuming these issues are specific to my environment rather than a bug in the ChromeDriver. But, still looking.

While using Selenium and chromedriver in JMeter, I get an error on chrome

I have inherited a JMeter performance testing script. There is a chromedriver section and an HTTPSampler section. The httpsampler section works fine. The chromedriver section runs into a problem. When I run it chrome pops up like this:
It does not move forward with any of the steps in the plan after that. Up until recently I've also been seeing the error
Error communicating with the remote browser. It may have died.
I am not seeing this now, so I don't know if it's just a difference in how the test is running or what.
The person I inherited this from was running it on a mac and did not get any of these problems. I saw it run with no errors at the same time I was getting them.
One solution I found was to add the --test-type flag to chromedriver. Unfortunately I cannot find a way to add that argument when running it through JMeter. I've tried adding both --test-type and -test-type to the end of the path to chromedriver.exe, but that did not work.
Does anyone have a solution for this?
The error might be due to conflict in chrome driver version. Please install the latest version of ChromeDriver from this link.
Latest version of Chrome Driver supports the browser version v56-58.

dyld fatal error when running XCUITest

I get a dyld fatal error as xcode attempts to initiate the UI test suite.
dyld: Library not loaded: #rpath/XCTest.framework/XCTest
Referenced from: /var/mobile/Containers/Bundle/Application/9A03F81B-1A93-4F0E-88B0-56C0748D1D43/ExampleUITests-Runner.app/XCTRunner
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/9A03F81B-1A93-4F0E-88B0-56D0748D1D43/ExampleUITests-Runner.app/Frameworks/XCTest.framework/XCTest: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/9A03F81B-1A93-4F0E-88B0-56D0748D1D43/ExampleUITests-Runner.app/Frameworks/XCTest.framework/XCTest'
So I'm running this on a Mac Mini which is a designated testing workstation. I have the same identical project on my macbook and it runs fine. I tried deleting my project and re-cloning it and it still goes through the same issue.
Any ideas on what the issue may be?
On a side note, I had this issue before. My solution was doing a re-format since re-installing Xcode and recloning my project from github did not fix the issue.
Error seems to suggest that Xcode is not able to locate XCTest.framework on your mac mini.Did you try adding $(PLATFORM_DIR)/Developer/Library/Frameworks to Framework Search Path of your UI Test Target.
You can also test adding XCTest.framework as a Build Phases Dependency.
It turned out it was an error regarding my certificates and this issue was resolved by revoking my certificates and resetting all of them.
Then I had to remove the problem apps from my device from Window > Devices and that allowed me to run my tests.

Chromedriver failing to launch or connect

Up until today, I have been using chromedriver to drive my watir-webdriver tests, and I have had no problems. My server still works and runs tests on the same version of the chromedriver and chrome.
I have tried updating to the latest chromedriver, which is the chromedriver 2 experimental build. This fails due to what I can only assume are still bugs being worked out of it.
I have also tried rolling back to the previous version of chromedriver with no success.
If anyone has any experience with this, I would really appreciate your expertise. I am sure it will turn out to be something simple I have overlooked.
gem versions:
watir-webdriver (0.6.2)
selenium-webdriver (2.29.0)
cucumber (1.2.1)
trace from the chromedriver below
Started ChromeDriver port=9517 version=26.0.1383.0
log=C:\Projects\oms_acceptance_tests\src\chromedriver.log
[6136:5300:0212/122320:ERROR:master_preferences.cc(110)] Failed to read master_preferences file at C:\Program Files (x86)\Google\Chrome\Application\master_preferences. Falling back to default preferences.
[6136:5300:0212/122320:ERROR:gpu_info_collector_win.cc(82)] Can't retrieve a valid WinSAT assessment.
test\automation\proxy_launcher.cc(107): error: Value of: app_launched
Actual: 5
Expected: AUTOMATION_SUCCESS
Which is: 0
Error while awaiting automation ping from browser process
[0212/122321:ERROR:proxy_launcher.cc(556)] Failed to ConnectToRunningBrowser
[0212/122321:ERROR:automation_proxy.cc(319)] Channel error in AutomationProxy.
Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe (Selenium::WebDriver::Error::UnknownError)
I would trying downloading newer version of chromedriver. Worked for me when I experienced similar issues.
To get rid of the gpu winsat error, try to update your display adapter.