"Unable to move the cache" error in selenium webdriver - google-chrome

While running the selenium webdriver script for chrome browser, I am getting the below error:
[2144:7568:0519/130434:ERROR:cache_util_win.cc(20)] Unable to move the cache: 0
[2144:7568:0519/130434:ERROR:cache_util.cc(134)] Unable to move cache folder C:\Users\Prudvi\AppData\Local\Google\Chrome\User Data\ShaderCache\GPUCache to C:\Users\Prudvi\AppData\Local\Google\Chrome\User Data\ShaderCache\old_GPUCache_000
[2144:7568:0519/130434:ERROR:cache_creator.cc(129)] Unable to create cache
[2144:7568:0519/130434:ERROR:shader_disk_cache.cc(589)] Shader Cache Creation failed: -2
Could some one help me out please

I assume you're starting your chrome driver attaching your default profile.
It's not the problem of your chrome driver, It's because you are running another chrome instance while you are starting your selenium webdriver, so some of the files in the profile is locked so that your selenium webdriver can not move it.
I encountered the same problem and shut down all chrome instances before starting my selenium webdriver solved the problem.

It is a problem with chrome driver installation. After I installed the chrome driver it worked for me. Thanks

This problem occurs due to the chormedriver api is not integrated with your project.
JUST DO THESE STEPS:
Configure your chormedriver api in your build path ( download from here http://chromedriver.storage.googleapis.com/index.html)
2.Go to the project right click ->>> go to build path ---> conf build path --> libraries --> add jar (add chromedriver jar file)
now add this code before the chormdriver object call.
System.setProperty("webdriver.chrome.driver", "path for your chormedriver api ");

It's because you must install selenium web driver instead of selenium IDE, download both & configure build path with that jar file.
Double check the import files which corresponds to selenium web driver, not selenium IDE.

Related

Selenium webdriver auto install chrome app

I want to run chrome from selenium with particular app installed in it. I am aware that we can load extensions in the chrome driver as explained here. I have tried to use the same code for unpacked app however it gives an error:
failed to load extension manifest file is missing or unreadable

Chrome error "you are using an unsupported command-line flag: --ignore-certificate-errors."

I am using Coded UI for testing my web application on Chrome. I am using the Cross Browser support offered by Coded UI.
I am using the below versions -
Visual Studio: 2013
selenium dotnet bindings: 2.43
When I start the web application in Chrome with BrowserWindow.CurrentBrowser = "Chrome", the chrome browser opens with the popup - "you are using an unsupported command-line flag: --ignore-certificate-errors. ...".
I found some suggestions on web but those seem to be for those who are directly using Selenium.
But, they do not seem to be applicable here as I am using Coded UI.
Can anyone tell me how do I address this problem?
Regards,
kvk1985
Please use below code, it worked me...
IWebDriver driver;
ChromeOptions options = new ChromeOptions();
options.AddArguments("--disable-extensions");
options.AddArgument("test-type");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("no-sandbox");
driver = new ChromeDriver(options);
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl("https://ahn-qa2.aon.com/home.aspx");
I was experiencing the same issue in Visual Studio 2013 Premium Update 4.
The latest version of chromedriver.exe (2.12) addressed the issue for us.
Download the applicable zip from the 2.12 directory at http://chromedriver.storage.googleapis.com/index.html
Right click on the downloaded zip file.
Select "properties".
Under "General" tab, click on the "Unblock" button.
Now unzip both the files and copy the contents to the following path. Copy over the existing version of chromedriver.exe
"%ProgramFiles%\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components" (for 32 bit machines)
"%ProgramFiles(x86)%\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components" (for 64 bit machines)
Launch Chrome with BrowserWindow.CurrentBrowser = "Chrome" again, the message should be gone.

Selenium Standalone fails to run tests in Google Chrome [duplicate]

This question already has answers here:
How to run Google Chrome with Selenium RC?
(5 answers)
Closed 9 years ago.
I'm using jenkins to run selenium standalone server and html test suites in a windows xp node.
I've managed to get it running and working for iexplore and firefox, but when it comes to googlechrome it fails in starting it.
This is the command I use to run the tests in googlechrome:
java -jar C:\...\selenium-server-standalone-2.28.0.jar -htmlSuite "*googlechrome C:\Program Files\Google\Chrome\Application\chrome.exe --allow-file-access-from-files –-disable-web-security" file:///C:/WebTest/Tests/ C:/WebTest/Tests/TestSuite.html C:\jenkins\workspace\sp-webTest\resultados\resultadoGC.html
And the error I get is:
12:43:08.044 INFO - Launching Google Chrome...
HTML suite exception seen:
java.lang.NullPointerException
at org.openqa.selenium.server.browserlaunchers.GoogleChromeLauncher.createCommandArray(GoogleChromeLauncher.java:168)
at org.openqa.selenium.server.browserlaunchers.GoogleChromeLauncher.launch(GoogleChromeLauncher.java:82)
at org.openqa.selenium.server.browserlaunchers.AbstractBrowserLauncher.launchHTMLSuite(AbstractBrowserLauncher.java:47)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:145)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:196)
at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:611)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:285)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:243)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)
Any help will be appreciated.
Specifying the webdriver in java helps.
System.setProperty("webdriver.chrome.driver", "c:/chromedriver.exe");
driver = new ChromeDriver();
Download link for chrome driver http://code.google.com/p/chromedriver/downloads/list
I got it working, somehow sending flags to chrome in the command causes selenium to throw null pointer exception. So what I did was add chrome to the PATH in mi xp node, use Selenium plugin to run html test suites in jenkins and specify a start url that begins with "https://" using google chrome and a start url that begins with "file:///" was a mess and couldn't get it to work like that. I also added the -trustAllSSLCertificates in "others" input box.
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"

JavaFx 2 applicaton does not run when i run it through HTML page

I have downloaded the javafx 2 samples and want to run in from its HMTL. For example there is one javafx application called BrickBreaker. For the specific sample the following files exist : BrickBreaker.jar, BrickBreaker.jnlp and BrickBreaker.html
When double clicking on jar or jnlp the application runs as expected but when i click on the html the application does not run. Instead i get the message "View the conectes of the page. Please install javaFX"
Why is that happening ? ( i have the javafx installed as the application runs when choosing the jar and jnlp files). My guess is that the html should be called from within the context of a webserver meaning that i should deploy my application first to a server and call the url from my explorer. For example if using glassfish i should call the url http://localhost:8080/Brickbraker
The problem is that i don't know how to deploy the javafx application in the server.
i tried to copy paste all the above three files in the autodeploy folder but it didnt worked...
Could you please help me?
Thanks in advance
EDIT: some more info - I have installed JDK 7 and JavaFX SDK 2.0.2
No, JavaFX is client technology, you don't need Glassfish to run it. JavaFX should run in browser the same way as Java plugins do.
If you can't run an application directly from html file it means your browser doesn't recognize you have runtime installed.
There can be next reasons for that:
JavaFX runtime is actually not installed (check in Windows Control Panel)
pure java plugin is not installed (you can check on java.com)
javafx runtime is 32bit and you are using 64bit browser (or vice versa)
you are using not supported browser (e.g. Safari)
you are using not supported system (at this moment, January 2012, only Windows supports runtime)

Running Chrome WebDriver on a linux server with no display

I'd like to run automated tests using selenium2's chrome webdriver on a linux server.
I've already set up firefox to run on the server by using Xvfb (See http://www.semicomplete.com/blog/geekery/xvfb-firefox.html) and would like to do something similar with chrome. Is this possible?
I was facing the same challenge of setting a linux box with selenium + chromedriver,
and here's my notes:
Pre-reqs:
Install JRE to run the selenium jar
Install the selenium server
grab the jar file from https://code.google.com/p/selenium/downloads/list)
Install xvfb (you've seem to have already achieved this part)
Install google-chrome for your linux distribution
Download the chrome driver
You can grab it from here: https://sites.google.com/a/chromium.org/chromedriver/downloads
Install other selenium dependencies that you might need (but the above is the minimum to get chromedriver to work)
To run:
Run xvfb
Xvfb :1 -screen 5 1024x768x8 &
export DISPLAY=:1.5
Run the selenium server jar with ChromeDriver options.
It'll look something like this:
java -jar selenium-server-standalone-2.30.0.jar -Dwebdriver.chrome.bin=/path/to/google-chrome -Dwebdriver.chrome.driver=/path/to/chromedriver
The selenium server log should output something similar to this:
Mar 19, 2013 10:07:27 AM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
Setting system property webdriver.chrome.bin to {location of google-chrome}
Setting system property webdriver.chrome.driver to {location of chromedriver}
10:07:34.258 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
10:07:34.259 INFO - Version Jetty/5.1.x
10:07:34.259 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
...
Reference:
http://www.yann.com/en/use-xvfb-selenium-and-chrome-to-drive-a-web-browser-in-php-23/08/2012.html
Cheers!
According to SetEnvironmentProperty to ChromeDriver programatically you can do the following:
service = new ChromeDriverService.Builder()
.usingChromeDriverExecutable(new File("/path/to/chromedriver"))
.usingAnyFreePort()
.withEnvironment(ImmutableMap.of("DISPLAY",":20"))
.build();
Here is the documentation for withEnvironment
I haven't been able to find a way to do this programmatically for the ChromeDriver like you can with the FirefoxBinary.
I've submitted a improvement request which has a patch attached to allow this. You can see it here: http://code.google.com/p/selenium/issues/detail?id=2673
Edit:
You can see below response from Stephen on how to use this now the change has been merged.: https://stackoverflow.com/a/16619608/998442
I get what you are trying to do, but you probably just run selenium grid. It was made for automated browser testing. Works great on a server.
https://www.selenium.dev/documentation/en/grid/