I created an appium project for writing mobile autotests, the appium server is running at:
0.0.0.0:4000
Apium Inspector successfully connects to this address, but when I try to run the test through IntelliJ, an error appears:
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'DESKTOP-HD34DIE', ip: '192.168.1.122'
File with capabilities configs:
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import org.openqa.selenium.By;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.net.URL;
public class LoginTest {
private AppiumDriver driver;
@BeforeMethod
public void setUp() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("automationName", "Appium");
capabilities.setCapability("deviceName", "Pixel_8");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "11");
capabilities.setCapability("appPackage", "com.example.login");
capabilities.setCapability("app", "E:/mobileTests/MobileTest/src/test/resourses/app/calculator.apk");
driver = new AndroidDriver(new URL("https://0.0.0.0:4000"), capabilities);
}
I tried changing the port and host values, but it doesn’t seem to see these settings.
I don’t fully understand the problem, why it doesn’t work.