<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>205532</bug_id>
          
          <creation_ts>2019-12-20 17:03:13 -0800</creation_ts>
          <short_desc>Flaky behaviour when creating a WebDriver session for iOS simulator</short_desc>
          <delta_ts>2019-12-20 17:03:13 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebDriver</component>
          <version>Safari 13</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="mwakizaka">mwakizaka0108</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bburg</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1601024</commentid>
    <comment_count>0</comment_count>
    <who name="mwakizaka">mwakizaka0108</who>
    <bug_when>2019-12-20 17:03:13 -0800</bug_when>
    <thetext>## 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.
```
{
    &quot;value&quot;: {
        &quot;sessionId&quot;: &quot;8E8AF3C3-B74B-4AF9-9020-20F3FC6D042B&quot;,
        &quot;capabilities&quot;: {
            &quot;safari:deviceName&quot;: &quot;iPhone 11 Pro Max&quot;,
            &quot;safari:platformVersion&quot;: &quot;13.2.2&quot;,
            &quot;safari:automaticInspection&quot;: false,
            &quot;webkit:WebRTC&quot;: {
                &quot;DisableICECandidateFiltering&quot;: false,
                &quot;DisableInsecureMediaCapture&quot;: false
            },
            &quot;browserVersion&quot;: &quot;13.0.3&quot;,
            &quot;safari:deviceType&quot;: &quot;iPhone&quot;,
            &quot;strictFileInteractability&quot;: false,
            &quot;browserName&quot;: &quot;Safari&quot;,
            &quot;safari:useSimulator&quot;: true,
            &quot;safari:platformBuildVersion&quot;: &quot;17B102&quot;,
            &quot;setWindowRect&quot;: false,
            &quot;acceptInsecureCerts&quot;: false,
            &quot;safari:deviceUDID&quot;: &quot;75AB2524-160C-4010-8EB0-C676B386363E&quot;,
            &quot;safari:automaticProfiling&quot;: false,
            &quot;platformName&quot;: &quot;iOS&quot;,
            &quot;safari:diagnose&quot;: false
        }
    }
}
```

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

## 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 &apos;Content-Type: application/json&apos; \
  -d &apos;{
  &quot;capabilities&quot;: {
    &quot;alwaysMatch&quot;: {
      &quot;platformName&quot;: &quot;ios&quot;,
      &quot;browserName&quot;: &quot;safari&quot;,
      &quot;safari:useSimulator&quot;: true
    }
  }
}&apos;
```

## Environment
- iOS version: iOS13.1 - 13.3 (Sorry, I couldn&apos;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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>