You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/site/docs/en/automate-with-scripts-in-yaml.mdx
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -367,6 +367,17 @@ ios:
367
367
# WebDriverAgent host address, optional, defaults to localhost.
368
368
wdaHost: <host>
369
369
370
+
# For gateways with a path prefix, use wdaBaseUrl instead of wdaHost/wdaPort.
371
+
# Setting wdaBaseUrl together with either wdaHost or wdaPort causes an error.
372
+
# wdaBaseUrl: <url>
373
+
374
+
# Optional independent MJPEG stream URL, including a gateway path if needed.
375
+
# Cannot be combined with wdaMjpegPort.
376
+
# wdaMjpegUrl: <url>
377
+
378
+
# Local MJPEG stream port, optional. Use this or wdaMjpegUrl.
379
+
# wdaMjpegPort: <port>
380
+
370
381
# Whether to auto dismiss keyboard, optional, defaults to false.
371
382
autoDismissKeyboard: <boolean>
372
383
@@ -383,6 +394,16 @@ ios:
383
394
# See the IOSDevice constructor documentation for the complete list
384
395
```
385
396
397
+
For a gateway with a path prefix, set `wdaBaseUrl` and leave `wdaHost` and `wdaPort` unset. The MJPEG stream can use a separate URL:
398
+
399
+
```yaml
400
+
ios:
401
+
wdaBaseUrl: ${WDA_BASE_URL}
402
+
wdaMjpegUrl: ${WDA_MJPEG_URL}
403
+
```
404
+
405
+
Set both environment variables before running the script. Studio Recorder exports use these references so gateway paths and access tokens stay out of the YAML file.
406
+
386
407
:::info View Complete iOS Configuration Options
387
408
388
409
YAML scripts now support all configuration options from the `IOSDevice` constructor. For the complete list of options, see [`IOSDevice`](./reference/#iosdevice) in the iOS API reference.
Copy file name to clipboardExpand all lines: apps/site/docs/en/platforms/ios.mdx
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,6 +233,27 @@ For remote devices, you also need to set up port forwarding accordingly:
233
233
iproxy 8100 8100 YOUR_DEVICE_ID
234
234
```
235
235
236
+
If a gateway exposes WDA under a path prefix, set the full API base URL instead:
237
+
238
+
```typescript
239
+
const agent =awaitagentFromWebDriverAgent({
240
+
wdaBaseUrl: 'https://gateway.example/device/wda',
241
+
});
242
+
```
243
+
244
+
Midscene appends `/status`, `/session`, and session commands to this base URL. Set either `wdaBaseUrl` or `wdaHost`/`wdaPort`; combining them throws an error.
245
+
246
+
`wdaBaseUrl` only configures the WDA API. By default, the native MJPEG stream still connects to `http://localhost:9100` when using a gateway. If the gateway also exposes a stream, set its complete URL separately:
`wdaMjpegUrl` accepts an HTTP(S) stream URL with its own host, port, path, and query. Credentials and fragments in the URL are rejected. It cannot be combined with `wdaMjpegPort`. For a local port forward, leave `wdaMjpegUrl` unset and use `wdaMjpegPort` (default `9100`). Playground falls back to screenshot polling if the native stream is unavailable.
256
+
236
257
### How to get smoother live screen preview in Playground?
-`wdaBaseUrl?: string` — Full HTTP(S) WDA API base URL, including a gateway path prefix. Cannot be combined with `wdaHost` or `wdaPort`.
2502
2503
-`iOSDeviceClassOverride?: string` — Optional npm module path that replaces the default `IOSDevice` when using `agentFromWebDriverAgent()` or iOS Playground. The module must export an `IOSDevice` class or a default class.
2503
2504
-`sessionId?: string` — Existing WebDriverAgent session ID to reuse. When provided, Midscene skips creating a new WDA session. During cleanup, Midscene detaches from the externally supplied WebDriver session instead of deleting it.
2504
2505
-`wdaMjpegPort?: number` — WDA MJPEG server port for real-time screen streaming. Default: `9100`.
2506
+
-`wdaMjpegUrl?: string` — Full HTTP(S) MJPEG stream URL, including any gateway path or query. Cannot be combined with `wdaMjpegPort`.
2505
2507
-`wdaMjpegFrameSource?: { enabled?: boolean }` — Use WDA's MJPEG stream as the continuous frame source for `agent.startObserving()`. Disabled by default; when disabled, observers fall back to sequential `screenshotBase64()` capture.
2506
2508
-`autoDismissKeyboard?: boolean` — Whether to hide the on-screen keyboard after text input. Default: `true`.
2507
2509
-`keyboardTypeDelay?: number` — Finite non-negative delay in milliseconds between keystrokes. A positive value makes legacy input enter one Unicode code point at a time through WDA's `/wda/keys` endpoint. Use this option when an input field drops characters during fast input.
@@ -2512,6 +2514,8 @@ const device = new IOSDevice({
2512
2514
2513
2515
- Ensure Developer Mode is enabled and WDA can reach the device; use `iproxy` when forwarding ports from a real device.
2514
2516
- Use `wdaHost`/`wdaPort` to target remote devices or custom WDA deployments.
2517
+
- Use `wdaBaseUrl` when a gateway routes WDA through a path prefix; all WDA API requests and readiness checks use that prefix.
2518
+
- Set `wdaMjpegUrl` separately when the native MJPEG stream is available through a gateway. The API base URL does not determine the stream URL.
2515
2519
- For multi-device concurrency, use distinct `wdaPort` and `wdaMjpegPort` values for each device so WDA commands and MJPEG streams do not conflict.
2516
2520
- For shared interaction methods, see [Shared Agent APIs](#interaction-methods).
0 commit comments