Troubleshooting
Solutions for common issues when testing Tauri applications with WebdriverIO.
Driver Installation Issues
"tauri-driver not found"
The service cannot find the tauri-driver executable.
Solution 1: Enable Auto-Installation
services: [
['@wdio/tauri-service', {
autoInstallTauriDriver: true, // Requires Rust/cargo
}]
]
Solution 2: Manual Installation
# Install tauri-driver via cargo
cargo install tauri-driver
# Verify installation
which tauri-driver # macOS/Linux
where tauri-driver # Windows
Solution 3: Specify Path Manually
If installed in a non-standard location:
services: [
['@wdio/tauri-service', {
tauriDriverPath: '/custom/path/tauri-driver'
}]
]
"WebKitWebDriver not found" (Linux only)
WebKitWebDriver is not installed on your Linux system.
Supported Distributions
Install for your distribution:
# Debian/Ubuntu
sudo apt-get install -y webkit2gtk-driver
# Fedora 40+
sudo dnf install -y webkit2gtk-driver
# Arch Linux
sudo pacman -S webkit2gtk-4.1
# Void Linux
sudo xbps-install -y webkit2gtk-devel
Unsupported Distributions
- Alpine Linux: Cannot build Tauri apps (musl incompatibility). Use Ubuntu, Debian, Fedora, or Arch instead.
- CentOS/RHEL: Stream 9 has glib too old (requires 2.70+), Stream 10 removed WebKitGTK. Use Fedora 40+ instead.
- openSUSE/SUSE: No official WebKitWebDriver package. Building from source is complex and not recommended.
"MSEdgeDriver not found" (Windows only)
The Edge WebDriver for Windows is not found.
Solution 1: Enable Auto-Download
services: [
['@wdio/tauri-service', {
autoDownloadEdgeDriver: true // Default: true
}]
]
Solution 2: Manual Download
-
Check your WebView2 version:
- Build your app:
cargo build --release - Right-click the .exe → Properties → Details
- Note the "File version" (e.g., 143.0.3650.139)
- Build your app:
-
Download matching MSEdgeDriver from Microsoft Edge WebDriver
-
Add to PATH or specify in config:
services: [
['@wdio/tauri-service', {
autoDownloadEdgeDriver: false
}]
]
See Edge WebDriver (Windows) for detailed setup.
Plugin Issues
"Tauri plugin not available"
The plugin required for testing is not detected.
Check 1: Plugin Registered in Rust
Edit src-tauri/src/main.rs:
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_wdio::init()) // This line required
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Check 2: Frontend Import Present
Ensure the import is in your HTML or main JS file:
<script type="module">
import '@wdio/tauri-plugin';
</script>
Check 3: withGlobalTauri Enabled
Edit src-tauri/tauri.conf.json:
{
"app": {
"withGlobalTauri": true
}
}
Check 4: Permissions Configured
Edit src-tauri/capabilities/default.json:
{
"permissions": [
"core:default",
"core:window:default",
"wdio:default"
]
}
Check 5: Rebuild Application
cd src-tauri
cargo clean
cargo build --release
See Plugin Setup for complete installation guide.
"window.wdioTauri is undefined"
The frontend plugin didn't initialize.
Solution 1: Add Delay for Initialization
it('should have plugin', async () => {
// Wait for plugin to initialize
await browser.pause(500);
const hasPlugin = await browser.tauri.execute(() => {
return typeof window.wdioTauri !== 'undefined';
});
expect(hasPlugin).toBe(true);
});
Solution 2: Check Import Timing
Make sure the plugin is imported before tests run:
- In
index.htmlfor standard Tauri apps - In your main framework entry point (main.ts, main.js)
- Not inside an iframe or separate context
Solution 3: Verify Plugin Loaded
it('should verify plugin is available', async () => {
const available = await browser.tauri.execute(() => {
return 'wdioTauri' in window;
});
expect(available).toBe(true);
});
Mocking Doesn't Work
Commands aren't being mocked.
Check 1: Plugin is Available
const available = await browser.tauri.execute(() => {
return 'wdioTauri' in window;
});
if (!available) {
throw new Error('Plugin not available - cannot mock');
}
Check 2: Mock Set Up Before Call
// ✅ Correct - mock first, then call
const mock = await browser.tauri.mock('my_command');
await mock.mockReturnValue('test');
await browser.tauri.execute(({ core }) => core.invoke('my_command'));
// ❌ Wrong - calling before mocking
await browser.tauri.execute(({ core }) => core.invoke('my_command'));
const mock = await browser.tauri.mock('my_command');
Check 3: Use Correct Command Name
// Make sure command name matches exactly
const mock = await browser.tauri.mock('get_user'); // Must match your command name
await mock.mockReturnValue({ id: 1 });
Application Issues
"Application not found at path"
The Tauri app binary cannot be found.
Solution 1: Verify Binary Exists
# Windows
if exist "src-tauri\target\release\my-app.exe" echo "Found"
# Linux/macOS
ls -la src-tauri/target/release/my-app
Solution 2: Build the Application
cd src-tauri
cargo build --release
Solution 3: Use Correct Path
Update wdio.conf.ts:
services: [
['@wdio/tauri-service', {
appBinaryPath: './src-tauri/target/release/my-app.exe', // Windows
// or
appBinaryPath: './src-tauri/target/release/my-app', // Linux/macOS
}]
]
Solution 4: Use Absolute Path
import path from 'path';
services: [
['@wdio/tauri-service', {
appBinaryPath: path.resolve('./src-tauri/target/release/my-app.exe')
}]
]
Commands Timing Out
Operations take too long or timeout unexpectedly.
Solution 1: Increase Command Timeout
services: [
['@wdio/tauri-service', {
commandTimeout: 60000 // 60 seconds instead of default 10s
}]
]
Solution 2: Increase Start Timeout
services: [
['@wdio/tauri-service', {
startTimeout: 60000 // Allow more time for app to start
}]
]
Solution 3: Wait for App to Be Ready
it('should wait for app', async () => {
// Give app time to fully initialize
await browser.pause(1000);
// Then run test
const element = await browser.$('button');
expect(element).toBeDefined();
});
Solution 4: Check App Logs
Enable logging to see what's happening:
services: [
['@wdio/tauri-service', {
captureBackendLogs: true,
captureFrontendLogs: true,
logLevel: 'debug'
}]
]
"Port already in use"
Multiple tests are conflicting on the same port.
Solution 1: Change tauri-driver Port
services: [
['@wdio/tauri-service', {
tauriDriverPort: 4445 // Instead of default 4444
}]
]
Solution 2: Auto-Assign Ports for Multiremote
maxInstances: 3 // Each worker gets unique port (4444, 4445, 4446)
Solution 3: Kill Process Using Port
# Linux/macOS
lsof -ti:4444 | xargs kill -9
# Windows (PowerShell)
Get-Process -Id (Get-NetTCPConnection -LocalPort 4444).OwningProcess | Stop-Process -Force
Platform Issues
"No driverProvider configured and no embedded WebDriver server detected"
The service cannot determine which driver provider to use.
Why this happens: On Windows and Linux, the service does not default to any driver provider automatically. It auto-detects the embedded provider only when either:
TAURI_WEBDRIVER_PORTenvironment variable is set, or- You are on macOS
Solution 1: Use embedded provider (recommended)
- Install
tauri-plugin-wdio-webdriverin your Tauri app:cd src-tauri && cargo add tauri-plugin-wdio-webdriver - Register it in your Rust code and set
TAURI_WEBDRIVER_PORTor configuredriverProvider: 'embedded':Or signal via environment variable:services: [['@wdio/tauri-service', {
driverProvider: 'embedded',
}]]TAURI_WEBDRIVER_PORT=4445 npx wdio run wdio.conf.ts
Solution 2: Use official tauri-driver
services: [['@wdio/tauri-service', {
driverProvider: 'official',
autoInstallTauriDriver: true,
}]]
See Platform Support for per-platform details.