Is Selenium Grid 4 compatible with v3 clients? - selenium-grid

Before I spent hours in setting up a Selenium v4 Grid, can someone confirm it is backward compatibility with existing clients?
I was not able to find anything in official documentation, nor in my searches.
We have an on-premises v3 implementation and all clients (mostly .NET and Java) are v3, so I am assessing the migration effort.

Java project set up using Selenium 3.141.59 works with Selenium Grid 4.0.0.
All browsers work with the remote selenium grid except EdgeChromium. That requires you to migrate your project to Selenium 4.0.0
Below is my simple docker-compose setup for a small project using Selenium Grid 4.0.0 where we test using the latest chrome browser
version: "3"
services:
selenium-hub-1:
image: selenium/hub:4.0.0
container_name: selenium-hub-1
ports:
- "4442:4442"
- "4443:4443"
- "4444:4444"
chrome-1:
image: selenium/node-chrome:latest
container_name: chrome-1
depends_on:
- selenium-hub-1
extra_hosts:
- "dev-centos8:192.168.101.102"
- "dev:192.168.101.102"
environment:
- SE_EVENT_BUS_HOST=selenium-hub-1
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
volumes:
- /downloads:/downloads
- /apps/functional-test:/apps/functional-test

after update to selenium4 all works fine with old selenium grid, but you need to refactor some part of your code
look what is deprecated / migration
also you can see selenium source code for look what is deprecated

Related

testContainers and Rancher

I have a Spring Boot application with integration tests that are using testContainers.
Till recently, I used Docker Desktop and was able to easily run the test from within Intellij or from CLI.
Recently I changed my Windows machine to Rancher desktop.
Now when trying to run the integration tests gradle integrationTest I'm getting this error:
Caused by: java.lang.IllegalStateException: Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration
at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:109)
at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:136)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:178)
at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
at org.testcontainers.LazyDockerClient.authConfig(LazyDockerClient.java:12)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:310)
Is there an additional configuration that is needed in Intellij or Rancher or Windows to make it work?
UPDATE Feb 2022: As reported here TestContainers works nicely with Rancher Desktop 1.0.1.
Based on the following two closed issues - first, second - in the testcontainers-java github, Testcontainers doesn't seem to support Rancher Desktop, at least officially.
I'm running rancher desktop version 1.0.0 on my windows mashine and could get testcontainers to work just by simple adding 'checks.disable=true' in .testcontainers.properties (located under C:\Users<your user>)
updating Rancher Desktop to version 1.0.1 fixed this issue for me
I got this error because my Rancher was using containerd. If you also use Rancher Desktop try to switch to dockerd under settings, but first back up the data you have just in case.

Codeception: Can't connect to WebDriver at http://chrome:9515/wd/hub

I tried to set up a very bare bones Codeception framework to see what the differences are between it and my enterprise framework for my own learning. My POC framework was running great until I tried to get it with docker and I don't know much about docker. I kept getting this error when trying to run with any docker command:
[ConnectionException] Can't connect to WebDriver at http://chrome:9515/wd/hub. Make sure that ChromeDriver, GeckoDriver or Selenium Server is running.
So I ripped out docker-compose.yml completely and tried to run tests the normal way:
./chromedriver --url-base=/wd/hub
and then in another tab
./vendor/bin/codecept run -vvv
But now I get the error from before! "[ConnectionException] Can't connect to WebDriver at http://chrome:9515/wd/hub. Make sure that ChromeDriver, GeckoDriver or Selenium Server is running. "
At this point, I would just be happy to get my framework back to running without docker. I have tried googling and other SO answers and they don't seem to help, I don't have anything weird in my bash or zsh profile. My other terminal says "ChromeDriver was started successfully." I shouldn't have a firewall. It was working before.
My acceptance.suite.yml is:
actor: AcceptanceTester
modules:
enabled:
- WebDriver:
url: http://localhost
window_size: false # disabled in ChromeDriver
port: 9515
browser: chrome
host: chrome
capabilities:
"goog:chromeOptions": # additional chrome options
- \Helper\Acceptance

Use existing file sharing / volumes in Docker-compose with Docker for Windows WSL2

With Docker for Windows 10 pro Hyper-V I work normally with File sharing. So in the Docker Desktop section Resources I add a folder like K:\data on my Windows host. This works well for me for many years.
So my current configuration is:
Windows 10 pro
Data folder on Windows 10 HOST is e.g. K:\data
Docker for Windows with Hyper-V
Docker compose (stack) file with 2 Docker images: MySql and Jenkins.
Docker components both access the data that is (via a volume specification) residing on the Windows host.
I investigate if I can switch to Docker for Windows WSL2. Then I would like to continue using the docker compose file with the 2 Docker containers. I would like to continue using the data that is residing on the Windows host. More specifically, on the K:\data.
Is it possible to switch from Docker for Windows with Hyper-V to Docker for Windows WSL2 and still use the existing data residing in the Windows folder?
This is not a duplicate question: I work with Docker compose, so I don't want to use the "docker run -v 'host'" solution. In my docker compose file I use e.g. the following line:
volumes:
- //k/data/spring-boot-app:/data/spring-boot-app
This question gets more important because since the new 2.5+ version, the Hyper-V version is hardly working on my standard Win10pro. The WSL2 worked immediately.
I pose this question as a simple user question, so others may benefit from it. I know that there is a world behind this topic.
Easy does it -- just switching to WSL2 works. I tried both the Docker for Windows 2.4 and 3.0.0 (21-12-2020) version.
Let me proof and explain in 2 simple steps. Take care of the way the volumes are used in the docker-compose.yml file.
First, just enabled the WSL2 in your Docker Desktop
1 - Demo with a simple app:
version: '3'
services:
chatbot:
image: myusernameatdocker/chatbot:1.0-SNAPSHOT
ports:
- 8080:8080
volumes:
- /k/data/chatbot:/data/chatbot
I created a simple Spring Boot application. It writes 1 line to my log file on Windows. That file I could perfectly read. Just on k:\data\chatbot\myfile.txt.
2 - Demo with an existing MySql environment:
version: '3'
services:
mymysqldb:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=root123
- MYSQL_DATABASE=mydatabase
- MYSQL_USER=johan
- MYSQL_PASSWORD=bladibladibla
volumes:
- /k/data/var/mysql-data:/var/lib/mysql
ports:
- "3306:3306"
I just started it and it works. Normally I had first to add a k:\data folder on first installing Docker. Now I didn't do that yet.
AND ... working with //k/data also worked. So, the MySql I use for many years still works.
Did I get the warning that accessing the Windows file system is slow? Yes. OK, in my case for development work not a big deal. It's okay, it works!

Error on Harbor as Docker Hub proxy when "Prevent Vulnerable Images" is enabled

I am using Harbor as Docker Hub Proxy, where the docker daemon was configure to point for this registry. This part is working ok.
But, I find a problem when I enable the option "Prevent Vulnerable Images" following the image below to the "library" project.
https://i.ibb.co/fDZKWN1/harbor.png
If this options is checked, the docker pull command don't work, showing the error below, but if is unchecked, the command work ok.
https://i.ibb.co/D9cMCXQ/error.png
- harbor version: v1.8.2 (online)
- docker engine version: 18.06.1-ce
- docker-compose version: 1.24.1
Github issue: https://github.com/goharbor/harbor/issues/9094
So far, Harbor does not fully support the registry mirror/proxy function. The good news is registry proxy/mirror is put into the Harbor roadmap now, you can check it here.

Protractor stuck at "Using the selenium server at http://..."

Background:
I start protractor with:
$ protractor protractor.eb.conf.js
This specifies a remote selenium server.
Sometimes my protractor tests just stall at this point:
[17:56:33] I/launcher - Running 1 instances of WebDriver
[17:56:33] I/hosted - Using the selenium server at http://selenium-server.example.com:4444/wd/hub
Questions:
What other information is needed?
Capabilities? Only using chrome.
Protractor version 5.1.1
What is this point in the process?
Launcher? Hosted?
Waiting for a node to become available?
What should I do to troubleshoot?
Edit:
Using remote selenium server.
directConnect:true,
You can add this in your conf.js file. This will not wait for the selenium server to start.
Coming to your other questions -
You also need to mention the framework you are using (for instance I use jasmine framework so I mention it like this) -
framework: 'jasmine',