Bug 205532 - Flaky behaviour when creating a WebDriver session for iOS simulator
Summary: Flaky behaviour when creating a WebDriver session for iOS simulator
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: Safari 13
Hardware: Unspecified macOS 10.14
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-20 17:03 PST by mwakizaka
Modified: 2019-12-20 17:03 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mwakizaka 2019-12-20 17:03:13 PST
## The problem
- In most cases, unable to create a webdriver session when using iOS simulators.

## Expected response
- I expect to get a response like the following.
```
{
    "value": {
        "sessionId": "8E8AF3C3-B74B-4AF9-9020-20F3FC6D042B",
        "capabilities": {
            "safari:deviceName": "iPhone 11 Pro Max",
            "safari:platformVersion": "13.2.2",
            "safari:automaticInspection": false,
            "webkit:WebRTC": {
                "DisableICECandidateFiltering": false,
                "DisableInsecureMediaCapture": false
            },
            "browserVersion": "13.0.3",
            "safari:deviceType": "iPhone",
            "strictFileInteractability": false,
            "browserName": "Safari",
            "safari:useSimulator": true,
            "safari:platformBuildVersion": "17B102",
            "setWindowRect": false,
            "acceptInsecureCerts": false,
            "safari:deviceUDID": "75AB2524-160C-4010-8EB0-C676B386363E",
            "safari:automaticProfiling": false,
            "platformName": "iOS",
            "safari:diagnose": false
        }
    }
}
```

## Actual response
```
{
    "value": {
        "error": "session not created",
        "message": "Could not create a session: Unable to find the RWISimulator associated with the booted simulator: 'iOS 13.2 (17B102) - iPhone 11 Pro Max' (75AB2524-160C-4010-8EB0-C676B386363E)",
        "stacktrace": ""
    }
}
```

## Steps to reproduce
0. Quit your Simulator.app in advance.
1. Launch safaridriver
/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/safaridriver --port 4444

2. curl by another terminal
```
curl -X POST \
  http://localhost:4444/session \
  -H 'Content-Type: application/json' \
  -d '{
  "capabilities": {
    "alwaysMatch": {
      "platformName": "ios",
      "browserName": "safari",
      "safari:useSimulator": true
    }
  }
}'
```

## Environment
- iOS version: iOS13.1 - 13.3 (Sorry, I couldn't control it)
- host machine version: 10.14.6
- safaridriver version: Included with Safari Technology Preview (Release 97, 14609.1.11.4)

## Note
- There is some tendency as the following.
    1. After launching a simulator by building an iphone app on xcode, it will be successful to create a webdriver session in most cases.
    2. When you launch a simulator by Simulator.app or W3C New Session API, it will fail to create a webdriver session in most cases.