I'm having issue in my automation tests project that started appearing recently. I cloned my repository from GitHub, built my project so all tests go through and when i wanted to fix some of the tests I got hit with:
no protocol:
java.lang.RuntimeException: no protocol:
at com.example.papajohnstests.tests.BaseAppium.setUp(BaseAppium.java:73)
It does work for some time after cloning. I can successfully run tests using ./gradlew build command and using green "Play" button in IntelliJ. I'm not modifying anything in initialization process, I'm not updating any libraries. I didn't even have a chance to fix issues in my tests so I'm really not doing anything that could affect creating session. It just stops working after some time. Here's the snippet of my setUp where session is created:
@BeforeEach
public void setUp(TestInfo testInfo) {
try (java.io.FileInputStream fis = new java.io.FileInputStream("config.properties")) {
prop.load(fis);
} catch (java.io.IOException e) {
System.err.println("File not found");
}
XCUITestOptions options = new XCUITestOptions();
String user = System.getenv("BROWSERSTACK_USERNAME");
String key = System.getenv("BROWSERSTACK_ACCESS_KEY");
System.out.println("USER: [" + user + "], KEY present: " + (key != null && !key.isBlank()));
String bsUrl = "https://" + user + ":" + key + "@hub-cloud.browserstack.com/wd/hub";
System.out.println("URL LENGTH: " + bsUrl.length());
System.out.println("URL START: " + bsUrl.substring(0, Math.min(15, bsUrl.length())));
try {
driver = new IOSDriver(new URL(bsUrl), options);
} catch (MalformedURLException e) {
throw new RuntimeException(e.getMessage());
}
Environment:
- Windows 10
- IntelliJ 2025.3.3
- Browserstack SDK 1.48.0
- JUnit 5.11.3
- Appium Java Client 10.0.0
- Selenium 4.39.0
- Microsoft OpenJDK 17.0.18
In terms of troubleshooting I:
Checked if URL is created properly and it is
Updated to latest Browserstack SDK which didn't help
Checked if Env variables are set and accessible