Hello!
I’m writing simple test using wdio:
const config = {
....
capabilities: {
browserName: 'safari',
browserVersion: '16.2'
}
};
const client = await wdio.remote(config);
console.log('session id:');
console.log(client.sessionId);
await client.url("https://google.com");
await client.pause(30000);
await client.saveScreenshot(`./test/out_${client.sessionId}.png`);
await client.deleteSession();
In most cases it works correctly, but in 10% of cases appium redirects from opened url to http://127.0.0.1:60862/health
:
e[38;5;183m[ae45b8bf]e[0me[38;5;87m[RemoteDebugger]e[0m The page https://google.com is ready in 321ms
e[38;5;183m[ae45b8bf]e[0me[38;5;87m[RemoteDebugger]e[0m Sending '_rpc_forwardSocketData:' message to app 'PID:47377', page '2', target 'page-113' (id: 60): 'Console.enable'
e[38;5;183m[ae45b8bf]e[0me[38;5;87m[RemoteDebugger]e[0m Received data response from send (id: 60): '{}'
e[38;5;183m[ae45b8bf]e[0me[38;5;87m[RemoteDebugger]e[0m Sending to Web Inspector took 7ms
e[38;5;183m[ae45b8bf]e[0me[38;5;147m[XCUITestDriver@14c6]e[0m Responding to client with driver.setUrl() result: null
e[38;5;183m[ae45b8bf]e[0me[38;5;86m[HTTP]e[0m <-- POST /session/.../url 200 332 ms - 14
e[38;5;183m[ae45b8bf]e[0me[38;5;87m[RemoteDebugger]e[0m Page changed: {
"1": {
"WIRTitleKey": "",
"WIRTypeKey": "WIRTypeWebPage",
"WIRURLKey": "http://127.0.0.1:60862/health",
"WIRPageIdentifierKey": 1,
"WIRConnectionIdentifierKey": "6d60b81e-b9f0-4215-8746-c290390f6619"
}
}
e[38;5;183m[ae45b8bf]e[0me[38;5;147m[XCUITestDriver@14c6]e[0m Remote debugger notified us of a new page listing: {"appIdKey":"47377","pageArray":[{"id":1,"title":"","url":"http://127.0.0.1:60862/health","isKey":true}]}
e[38;5;183m[ae45b8bf]e[0me[38;5;147m[XCUITestDriver@14c6]e[0m New page listing from remote debugger does not contain current window; assuming it is closed
e[38;5;183m[ae45b8bf]e[0me[38;5;147m[XCUITestDriver@14c6]e[0m Debugger already selected page '1', confirming that choice.
e[38;5;183m[ae45b8bf]e[0me[38;5;147m[XCUITestDriver@14c6]e[0m Redirected from 'https://google.com' to 'http://127.0.0.1:60862/health'
Could you please help me to undestand why does this happen?
Appium version 2.11.0