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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Enterprise Kubernetes Failures: 20 Critical Misconfigurations Guardon Catches Before Outages
  • 7 Tips for Effective Cybersecurity Training for Developers
  • Mastering Thread-Local Variables in Java: Explanation and Issues
  • Keep Your Application Secrets Secret

Trending

  • From Issue to Reviewable Patch: Build a Sandboxed Coding Agent With Deep Agents and Automated Tests
  • Building a Real Pipeline With senro: Monorepos, Caching, and Triggers
  • Engineering Data Observability: Detecting Schema Drift, Data Drift, and Silent Pipeline Failures
  • GET, POST, PUT, DELETE: Choosing HTTP Verbs in a Real .NET Core Web API, Not Just by the Textbook

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
Updated Oct. 10, 21 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
14.1K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

  • Enterprise Kubernetes Failures: 20 Critical Misconfigurations Guardon Catches Before Outages
  • 7 Tips for Effective Cybersecurity Training for Developers
  • Mastering Thread-Local Variables in Java: Explanation and Issues
  • Keep Your Application Secrets Secret

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

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 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook