Run Selenide web app test

Step 1: Setup environment


Step 2: Run sample test

NOTE: The Selenide adds goog:chromeOptions capability inside ChromeDriverFactory class and it will cause the invalid argument: cannot parse capability error if you will start a WebDriver session using default Selenide way – set capabilities to Configuration.browserCapabilities and just call method.
According to this, we recommend to start a RemoteWebDriver session and then just call WebDriverRunner.setWebDriver using received WebDriver instance.

package com.mobitru;

import com.codeborne.selenide.Condition;
import com.codeborne.selenide.Selenide;
import com.codeborne.selenide.WebDriverRunner;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.nio.charset.StandardCharsets;

import static java.lang.String.format;
import static org.junit.Assert.assertEquals;

public class SelenideDemo {
    private static final String PROJECT_NAME = "EPM-TSTF";

    private static final String ACCESS_KEY = "--------- YOU ACCESS KEY -----------";
    private static final String APPIUM_HUB = "";
    private static final String PLATFORM_VERSION = "11"; //or 15.6 for iOS
    private static final String BROWSER_NAME = "chrome"; //or safari for iOS
    private static final String DEVICE_NAME = "GOOGLE Pixel 4 XL"; //or IPHONE iPhone13,2 for iOS

    private final DesiredCapabilities capabilities;


    public SelenideDemo() {
        capabilities = new DesiredCapabilities();
        capabilities.setCapability("appium:platformName", "Android"); //or iOS
        capabilities.setCapability("appium:browserName", BROWSER_NAME);
        capabilities.setCapability("appium:deviceName", DEVICE_NAME);

    public void before() throws Exception {
        String connectionUrl = format("https://%s:%s@%s/wd/hub", PROJECT_NAME, ACCESS_KEY, APPIUM_HUB);
        if (!WebDriverRunner.hasWebDriverStarted()) {
            WebDriver driver = new RemoteWebDriver(new URL(connectionUrl), capabilities);

    public void demoTest() {
         final String openUrl = "";;
        assertEquals("Current url is incorrect", openUrl, Selenide.webdriver().driver().url());
        assertEquals("Page title is incorrect", "Google", Selenide.title());

    public void after() {
Scroll to Top