We are using Intern to test our application. We have three different Intern configuration files which we use to target either a local instance of Selenium, an instance running on a local virtual machine, or Sauce Labs.
Intern runs tests against Firefox on both the local instance and the virtual machine without error. However, when I add Chrome to the list of browsers I would like to be tested against, on both the local and virtual machine instance, I get an error indicating: "The environment you requested was unavailable". I know that the required browser is available in both locations, and in fact I know that this process has worked in the past. What could have changed and what do I need to configure to make Intern and or Selenium see Chrome again?
I'm working on a machine running Windows 7 and the VM I have installed runs up an Ubuntu image, carefully installing Firefox, Chrome and PhantomJS along the way.
When running against a local instance of Selenium we are using the following configurations:
capabilities: {
'selenium-version': '2.39.0'
},
environments: [
{ browserName: 'chrome' },
{ browserName: 'firefox' }
]
When running against Selenium on an Ubuntu VM we are using the following configurations:
capabilities: {
'selenium-version': '2.39.0'
},
environments: [
{ browserName: 'chrome' },
{ browserName: 'firefox' },
{ browserName: 'phantomjs' }
]
Since raising this question I have made some progress with the VM version of the testing. Our setup.sh file which configures the various components added to the VM was referencing an old version of chromedriver:
Old configuration:
wget "https://chromedriver.googlecode.com/files/chromedriver_linux64_2.3.zip"
unzip chromedriver_linux64_2.3.zip
mv chromedriver /usr/local/bin
Became:
wget "http://chromedriver.storage.googleapis.com/2.9/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip
mv chromedriver /usr/local/bin
At the moment I am still unable to make the local version of our tests run Chrome however. The chromedriver is installed as part of Intern as far as I can see and even though I cleared my npm cache and reinstalled, and in fact even when I replaced the automatically included chromedriver with one downloaded manually, it still gives me the "The environment you requested was unavailable" fault.
Back in the VM environment we are trying to use PhantomJS. Intern seems to be able to initialise an instance of Phantom but it then hangs before any tests have been run. Phantom includes its own (ghost)driver and I believe its startup is configured correctly as follows:
echo "Starting Phantomjs ..."
phantomjs --ignore-ssl-errors=true --web-security=false --webdriver=192.168.56.4:4444 &
If anyone has any pointers to making chrome work on my local machine and phantom work on the VM I would be most welcome.
Related
I'm struggling to upload a floppy image (same goes with cd_rom image) from Packer using the vsphere-iso plugin.
I was able to deploy a Linux ISO file located in a datacenter within vCenter and it works well.
As soon as I have some provisioning using floppy of cdrom images that needs to be uploaded to the datastore, it fails.
I can successfully upload the files manually from the vSphere Client UI which means vCenter privileges are just fine for my user (I'm not full admin on the ESXi).
Using vshere-iso builder to deploy an ISO file available in the ESXi datastore, provisioning it with a floppy image for the OS installation.
Datastore ISO is correctly detected and mounted but the build fails everytime during floppy image upload.
Please excuse any information I could have missed that would be required to troubleshoot
Any idea or help is very welcomed.
Reported on Packer github as well: https://github.com/hashicorp/packer/issues/11655
Thank you !
Overview of the Issue
Reproduction Steps
Run following command using the builder below:
packer build -debug -var 'username=xxx' -var 'password=yyyy' .
Randomly, one build outputs a **404 Not found** error and one build outputs a **write tcp 10.1.21.208:57236->10.1.11.230:443: write: broken pipe**
In every case, the HTTP request that seems to fail is:
Put "https://<host>/folder/<vm-name-folder>/packer-tmp-created-floppy.flp?dcPath=<datacenter>&dsName=<datastore>
Packer version
1.8.0
Simplified Packer Template
packer-template.pkr.hcl
Operating system and Environment details
Ubuntu 20.04.4 LTS
vCenter version 6.7
Log Fragments and crash.log files
packer-broken-pipe-error.log
packer-404-not-found.log
I am running tests in Jenkins and the tests are running on outdated Chrome 71 and I want to update the chrome it is using. I've tried updating my package.json to current TestCafe but it is still running 71. when I run node_modules/.bin/testcafe --version it just lists firefox, chrome. It seems that since the chrome is in node_modules I should be able to update to latest but I haven't found anything online to show how to do so.
Running locally on my machine chrome is v91. I thought doing an 'npm i' locally and pushing that branch would update but it was not successful.
Jenkins output:
npm i
node_modules/.bin/testcafe --version
1.15.0
node_modules/.bin/testcafe -e chrome:headless auth-subscriber-signs-in-validates-homepage.js
Running tests in: Chrome 71.0.3578.98 / Linux 0.0
TestCafe doesn't upgrade or downgrade browsers. It just searches the installed browsers and runs tests in them. You need to inspect the Jenkins job and found the way how browsers are installed for it.
I face the problem with running protractor tests in headless environment. I know about option with Chrome, which implies setting up like that:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [ "--headless", "--disable-gpu" ]
}
}
However when using this method, I am obliged to have Chrome installed on my system which isn't option for me because I can't be sure about environment which my tests will be run in. PhantomJS would be great in my case, because everything you need is just install npm package. But PhantomJS in deprecated at the moment and can cause some unexpected bugs.
So my question is: Is there any way to use headless Chrome or some other alternative (like PhantomJS) which won't oblige me to install any browser?
Thank you for your time.
while I was trying to test my app on Pebble Emulator using Pebble SDK 3.0, I met a connection problem. The Emulator is working normally, but my host machine can't connect to QEMU virtual machine. So, the app wasn't fired up. See followings:
> pebble build
> pebble --debug install --emulator aplite
[INFO ] Starting phone simulator...
[ERROR ] Could not connect to phone at localhost:12342. Ensure that 'Developer Connection' is enabled in the Pebble app.
I don't know how to do further debugging on this issue.
According to the developer docs if you aren't using the native version of Python (eg. you installed Python with Homebrew or you are using Pyenv, etc.) you need to do the following - with your new version of Python active:
> brew remove boost-python
> brew install boost-python --build-from-source
This fixed things for me.
If your emulator is in a system folder that requires sudo access you will have to type:
sudo pebble --debug install --emulator aplite
You can find where your pebble bin folder is located with
which pebble
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/