DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • 7 Tips for Effective Cybersecurity Training for Developers
  • Mastering Thread-Local Variables in Java: Explanation and Issues
  • Keep Your Application Secrets Secret
  • Don’t Let Kubernetes Developers Suffer From Solved Problems

Trending

  • My LLM Journey as a Software Engineer Exploring a New Domain
  • Zero Trust for AWS NLBs: Why It Matters and How to Do It
  • Software Bill of Materials (SBOM): Enhancing Software Transparency and Security
  • 5 Best Node.js Practices to Develop Scalable and Robust Applications
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Selenium Grid 4 and Appium

Selenium Grid 4 and Appium

Selenium Grid 4 released support for non-browser WebDrivers. See how to set up a new Grid with Appium.

By 
Dmytro Budym user avatar
Dmytro Budym
·
Updated Oct. 10, 21 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
13.4K Views

Join the DZone community and get the full member experience.

Join For Free

Selenium Grid 4 is already in the prerelease stage. That means that now is a great time to check updates on your current project and be ready for the changes and new features.

Hub implementation was redesigned. Now it has a distributed architecture. A few weeks ago, the developers added support for non-browser WebDrivers. In other words, you can migrate your Appium clusters to a new Grid.

Grid 3 setup with Appium for IOS was like this:

It was required to prepare a configuration file and run Appium with a pointer to that config:
appium —nodeconfig config.json

The relationship between Selenium Server and Appium was very close and, after changes in Selenium code, developers needed to communicate with the Appium team for compatibility.

In a fresh implementation of Grid, a connection of non-browser WebDrivers is implemented via relay. You can set up a WebDriver endpoint, and Grid Node will send commands to it. This service endpoint can be an Appium server or any other service, even a cloud provider that supports the WebDriver API.

Selenium Grid 4 interacts with the node, and the node interacts with the connected service:

This setup is different from the previous version. First of all, you need to prepare a configuration file in toml format, where you set the Appium URL in the relay section and available environments in the config block.

TOML
 
[node]
detect-drivers = false

[relay]
url = "http://192.168.0.102:4724/wd/hub"
status-endpoint = "/status"
configs = [
  "1", "{\"browserName\": \"iPhone 12 Pro Max\", \"platformName\": \"iOS\", \"appium:platformVersion\": \"15.0\"}"
]


Start services:

  • Appium, which will be connected to node
  • Selenium Grid 4
  • Selenium Grid Node the with prepared configuration

I prepared a simple docker-compose.yml, which starts a hub and nodes:

YAML
 
version: "3.3"
services:
  grid-4:
    container_name: grid-4
    image: selenium/hub:4.0.0-rc-2-prerelease-20210916
    environment:
      - GRID_TIMEOUT=140
      - GRID_BROWSER_TIMEOUT=120
    ports:
      - "4442-4444:4442-4444"

  node-1:
    container_name: node-1
    image: selenium/node-docker:4.0.0-rc-2-prerelease-20210916
    volumes:
      - "${PWD}/config1.toml:/opt/bin/config.toml"
    environment:
      - SE_EVENT_BUS_HOST=grid-4
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_HOST=grid-4

  node-2:
    container_name: node-2
    image: selenium/node-docker:4.0.0-rc-2-prerelease-20210916
    volumes:
      - "${PWD}/config2.toml:/opt/bin/config.toml"
    environment:
      - SE_EVENT_BUS_HOST=grid-4
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_HOST=grid-4


After services become ready, feel free to use the host and run tests. UI console now has a modern design where you can see available nodes and active sessions.

For more details, see the official documentation. I recommend trying a new Grid on your current project.

Waiting for official release.

Implementation dev cluster Host (Unix) Release (computing) Session (web analytics) YAML

Opinions expressed by DZone contributors are their own.

Related

  • 7 Tips for Effective Cybersecurity Training for Developers
  • Mastering Thread-Local Variables in Java: Explanation and Issues
  • Keep Your Application Secrets Secret
  • Don’t Let Kubernetes Developers Suffer From Solved Problems

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!