diff --git a/lib/webdriveragent.js b/lib/webdriveragent.js index a8019e056..f5cda7ee3 100644 --- a/lib/webdriveragent.js +++ b/lib/webdriveragent.js @@ -58,7 +58,7 @@ export class WebDriverAgent { this.setWDAPaths(args.bootstrapPath, args.agentPath); this.wdaLocalPort = args.wdaLocalPort; - this.wdaRemotePort = (this.isRealDevice ? (args.wdaRemotePort ?? args.wdaLocalPort) : args.wdaLocalPort) + this.wdaRemotePort = ((this.isRealDevice ? args.wdaRemotePort : null) ?? args.wdaLocalPort) || WDA_AGENT_PORT; this.wdaBaseUrl = args.wdaBaseUrl || WDA_BASE_URL;