We are excited to announce a new upgrade to the TestingBot testing capabilities: TestingBot now supports automated testing for Electron applications in the cloud!
Electron is a framework that lets developers build cross-platform desktop applications using web technologies such as JavaScript, HTML and CSS. It's used by popular apps such as Slack, Visual Studio Code and GitHub Desktop. With Electron, developers can create applications that work seamlessly on both Windows and macOS, while sharing a single codebase.
With this new release, developers and QA can now run automated tests against these native apps, running on remote Windows and macOS machines in the TestingBot cloud. Electron has a tutorial on how to run automated tests with Electron.
Electron Automated Testing Example
To get started, you will need to upload your Electron app to TestingBot Storage and indicate in your Selenium test script which app should should be tested, together with the Electron version.
Indicate which operating system needs to be used and TestingBot will provision a remote machine with your Electron app pre-installed. Please see the Java example below:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.http.ClientConfig;
import org.openqa.selenium.remote.http.HttpClient;
import org.openqa.selenium.remote.http.HttpClient.Factory;
import java.net.URL;
import java.util.Random;
public class SeleniumTest {
public static void main(String[] args) {
try {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserName", "electron");
caps.setCapability("platformName", "VENTURA");
caps.setCapability("browserVersion", "31");
caps.setCapability("tb:binary_location", "testingbot-electron-demo-app.app/Contents/MacOS/testingbot-electron-demo-app");
caps.setCapability("tb:app", "https://github.com/testingbot/testingbot-electron-demo-app/releases/download/v1.0.0/testingbot-electron-demo-app-darwin-arm64-1.0.0.zip");
WebDriver driver = new RemoteWebDriver(
new URL("https://key:secret@hub.testingbot.com/wd/hub"),
caps
);
// Generate two random numbers between 0 and 9
Random random = new Random();
int num1 = random.nextInt(10);
int num2 = random.nextInt(10);
WebElement firstNumber = driver.findElement(By.id("btn-" + num1));
WebElement secondNumber = driver.findElement(By.id("btn-" + num2));
WebElement plus = driver.findElement(By.id("btn-plus"));
WebElement equal = driver.findElement(By.id("btn-equal"));
firstNumber.click();
plus.click();
secondNumber.click();
equal.click();
WebElement resultElement = driver.findElement(By.id("calc-display"));
String resultText = resultElement.getText();
// Verify the result
if ((num1 + num2) != Integer.parseInt(resultText)) {
throw new AssertionError("Test failed");
}
// Quit the driver
driver.quit();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Please see the Electron documentation for more information and examples.
Run Electron Tests on Multiple Operating Systems
Your Electron apps might behave differently on various platforms. TestingBot enables you to run your tests on both Windows and macOS environments, ensuring that your application functions as expected across all platforms your users might be on. Electron testing on TestingBot is currently supported on the following operating systems:
- Windows 11
- Windows 10
- macOS Sonoma
- macOS Ventura
- macOS Monterey
High Parallel Testing
Speed up your testing process with TestingBot’s high parallel testing capabilities. By running multiple tests simultaneously, you can drastically reduce the time it takes to validate your app across different operating systems. This in turn means faster release cycles and more time to focus on building features, rather than waiting for your tests to complete.
By integrating automated Electron tests with TestingBot into your CI/CD pipeline, you'll accelerate your app releases while ensuring the highest quality for your Electron application.
Detailed Test Reporting
Every Electron test you run on TestingBot comes with a video recording of the test and generated log files, to help you identify and fix issues quickly.
Ready to get started? Sign up for free and start testing your Electron app.