Giter Site home page Giter Site logo

appium / appium-xcuitest-driver Goto Github PK

View Code? Open in Web Editor NEW
720.0 62.0 410.0 77.37 MB

Appium iOS driver, backed by Apple XCTest

Home Page: https://appium.github.io/appium-xcuitest-driver/

License: Apache License 2.0

JavaScript 86.47% Rich Text Format 0.04% HTML 0.03% TypeScript 13.45%

appium-xcuitest-driver's Introduction

appium-xcuitest-driver

npm version Downloads

Release

This is an Appium driver for automating iOS applications on iOS, iPadOS, and tvOS. You can add it to your Appium 2+ server install: (Only macOS is supported as the host platform, as it requires Xcode and developer tools.)

appium driver install xcuitest

Documentation

The Documentation is hosted separately at https://appium.github.io/appium-xcuitest-driver

Contributing & Development

Clone this project from GitHub and run:

npm install

To watch changes during the development:

npm run watch

To run unit/functional tests:

npm test # unit 
npm run e2e-test # functional

There are also a number of environment variables that can be used when running the tests locally. These include:

  • REAL_DEVICE - set to anything truthy, makes the tests use real device capabilities
  • _FORCE_LOGS - set to 1 to get the log output, not just spec
  • PLATFORM_VERSION - change the version to run the tests against (defaults to 9.3)
  • XCCONFIG_FILE - specify where the xcode config file is for a real device run (if blank, and running a real device test, it will search for the first file in the root directory of the repo with the extension "xcconfig")
  • UICATALOG_REAL_DEVICE - path to the real device build of UICatalog, in case the npm installed one is not built for real device

appium-xcuitest-driver's People

Contributors

alei01 avatar aluedeke avatar boneskull avatar dependabot-preview[bot] avatar dependabot[bot] avatar dpgraham avatar eglitise avatar erustusagutu avatar flekmatik avatar github-actions[bot] avatar greenkeeper[bot] avatar imurchie avatar jlipps avatar joelwhitney avatar jonahss avatar kazucocoa avatar mrmacete avatar mwakizaka avatar mykola-mokhnach avatar nozomiito avatar priyeshkpandey avatar rafe-g avatar renovate[bot] avatar rerorero avatar semantic-release-bot avatar umutuzgur avatar vrunoa avatar yaphatak avatar yaumu3 avatar zcmgyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appium-xcuitest-driver's Issues

Enabled and visibility false for all elements

On master for appium-xcuitest-driver and using the appium_python_client, all the elements are listed as false for enabled and visible. I am still able to interact with the element like clicking. Not sure if this is a driver issue or client issue.

For example this is what is outputted when I print the page source

                                    <Table name="Playlist Table View" label="Playlist Table View" value="" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2" x="0" y="108" width="375" height="559">
                                        <Image name="" label="" value="" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/0" x="0" y="64" width="375" height="44">
                                        </Image>
                                        <SearchField name="Search playlists" label="Search playlists" value="" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/1" x="8" y="72" width="359" height="28">
                                        </SearchField>
                                        <Other name="" label="" value="" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/2" x="0" y="108" width="375" height="28">
                                            <StaticText name="Game Footage" label="Game Footage" value="Game Footage" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/2/0" x="0" y="108" width="375" height="28">
                                            </StaticText>
                                        </Other>
                                        <Cell name="AHS vs Island High" label="AHS vs Island High" value="" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/3" x="0" y="136" width="375" height="75">
                                            <StaticText name="AHS vs Island High" label="AHS vs Island High" value="AHS vs Island High" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/3/0" x="110" y="143" width="195" height="30">
                                            </StaticText>
                                            <StaticText name="by Coach Admin" label="by Coach Admin" value="by Coach Admin" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/3/1" x="110" y="175" width="136" height="21">
                                            </StaticText>
                                            <StaticText name="117" label="117" value="117" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/3/2" x="310" y="163" width="30" height="21">
                                            </StaticText>
                                        </Cell>
                                        <Other name="" label="" value="" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/4" x="0" y="211" width="375" height="0.1000000014901161">
                                        </Other>
                                        <Other name="Game Footage" label="Game Footage" value="" dom="" enabled="false" valid="true" visible="false" hint="" path="/0/0/0/2/0/1/0/0/2/5" x="0" y="108" width="375" height="28">
                                        </Other>
                                    </Table>

Roadmap for getting driver into working order

Work to be done

Appium iOS endpoints

WDA endpoints

The appium-safari-driver needs much work.

Session commands:

  • Handle the optional requiredCapabilities that Appium supports

Selenium commands

  • Navigation commands (forward, back, refresh)
  • element submit
  • element selected
  • element equals other element
  • touch commands
    • moveto
    • click
    • flick
  • get geo location
  • set geo location
  • get log types
  • get logs
  • Tests
    • screenshot
    • window size
    • find commands (single, multiple, in the context of another element)
    • element text
    • element set value
    • keys
    • element name
    • element clear
    • element displayed
    • element location
    • element location_in_view
    • element size
    • get orientation
    • set orientation

Appium commands

All Appium-specific commands need to be implemented. This is mostly involving
looking at appium-ios-driver and seeing how to reorganize it to allow us to
import those methods here. Anything that requires UIAutomation and Instruments
will have to have that factored out so that we can make the appropriate calls
to WDA, if available.

Some things in particular:

  • touch actions
  • touch multi actions

Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.0'

when I run appium with this last commit appium/appium@bf71e40

iOS 10 (real device) & Xcode 8

[XCUITest]
Testing failed:
    Signing for "WebDriverAgentRunner" requires a development team. Select a development team in the project editor.

[XCUITest]  Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.0'
** TEST FAILED **


The following build commands failed:
    Check dependencies
(1 failure)

[XCUITest] xcodebuild exited with code '65' and signal 'null'

Unhandled endpoint: /session/.../timeouts

Hello,

When trying to run my tests I get the following exception:
org.openqa.selenium.WebDriverException: Unhandled endpoint: /session/6E4763B8-D534-4B5A-88CF-AE736FD31C93/timeouts -- http://localhost:8100/ with parameters { wildcards = ( "session/6E4763B8-D534-4B5A-88CF-AE736FD31C93/timeouts" ); }

Because of that issue I'm unable to test the new driver and I'd love to check it out,
so if anyone knows a work-around for this please share it with me :)

More info:

  • Server logs: LINK
  • IDE Stacktrace: LINK
  • Selenium-java version: 2.53.0
  • Java-client version: 3.4.1

What I did:

  1. I cloned the repo using:
git clone --recursive https://github.com/appium/appium-xcuitest-driver.git
  1. Built the project:
rm -rf node-modules
npm install
gulp transpile
  1. Started the server
node .
  1. Run tests in my IDE

If some more information is required please let me know and I'll gladly provide that.

Thanks

build fails

Failed in submodule update:

~/code/appium-xcuitest-driver $ git submodule update
Cloning into 'WebDriverAgent'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of '[email protected]:appium/WebDriverAgent.git' into submodule path 'WebDriverAgent' failed

Scroll without specifying element

With the current Appium and Node.js client WD, it accepts

driver.execute("mobile: scroll", [{ direction: 'up' }])

to do the scroll operation.

With XCUItest driver, it seems an extra element is required now:

[HTTP] --> POST /wd/hub/session/34ac6c12-eb9a-466a-a4cf-8c67086bf189/execute {"script":"mobile: scroll","args":[{"direction":"down"}]}
[MJSONWP] Calling AppiumDriver.execute() with args: ["mobile: scroll",[{"direct...
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted "Mobile scroll needs an element" and you sent undefined
[HTTP] <-- POST /wd/hub/session/34ac6c12-eb9a-466a-a4cf-8c67086bf189/execute 400 5 ms - 92

And it seems @yaphatak 's PR for WDA was not accepted.

I am wondering what's the equivalent of scrolling the entire UIApplication without specifying an element? And if we have to add element now, is there anyway to do it in the chainable API way in WD.js ?

Timeout unhandled endpoint.

RemoteWebDriver did a refactor (here)[https://github.com/SeleniumHQ/selenium/commit/65dc17ed3435a0c4d1935e45314f4913f4e02d4e#diff-fa76272f866d8067bb11a32f27773026R817] where the timeout command changes from implicitWait to setTimeout, this breaks with XCUITest Driver.

Options:

  1. Map this in appium-xcuitest-driver to implicit wait endpoint.
  2. Change remote webdriver back to using DriverCommand.IMPLICITLY_WAIT instead of DriverCommand.SET_TIMEOUT.
  3. Make a pull request to try and add that endpoint to the webdriver agent, which I dont think they will accept as the old implicit endpoint is already there. (appium-xcuitest-driver uses WebDriverAgent as a dependency, not the other way around).

Ideally i would say option 1, although is there any reason why this wouldnt be an acceptable revert?
@jlipps @imurchie @Jonahss

Help with extending desired capabilities

Hey guys,

I'm having trouble finding out how to add desired capabilities to this driver and I would really appreciate if someone could point me in the right direction. (Where to look, so I can try to implement it)

I want to add 'processArguments' capability, which already works standard appium driver, to be able to pass arguments to the app I'm launching.

Here is the log:
info MJSONWP Calling WebDriverAgentDriver.createSession() with args: [{"app":"path-to.app","platformVersion":"9.2","platformName":"iOS","processArguments":"-ARG FUBAR"...

WARN BaseDriver The following capabilities were provided, but are not recognized by appium: app, processArguments.

Which seems a bit strange, as it actually passes the "app" argument as I can successfully launch my application:

info JSONWP Proxy Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"app":"path-to.app","bundleId":"com.fu.bar"}}

And I'd love to pass the "processArguments" here too.

Any help would be really appreciated.

Thanks!

Cannot run tests on Yosemite

After doing the setup asked in README.md I attempted to run the tests on this yosemite. Most of them won't run. Simulator boots up but I don't see the app opening. The webview tests opens up appium but stops immediately.
pasted image at 2016_01_25 04_04 pm

Cant pull submodule WebDriver

appium-xcuitest-driver user$ git submodule init

Submodule 'WebDriverAgent' ([email protected]:appium/WebDriverAgent.git) registered for path 'WebDriverAgent'

appium-xcuitest-driver user$ git submodule update

Cloning into 'WebDriverAgent'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of '[email protected]:appium/WebDriverAgent.git' into submodule path 'WebDriverAgent' failed

Handle WebDriverAgent /uiaelement/ routes

Webdriveragent supports many nice new XCUITest behaviors like scrolling with the /uiaElement/:id/value route convention. An example of this is pickers:

In the former iOS driver we were handling sending commands to pickers as follows:
dob_field = self.driver.find_element_by_name("form_dob_field")
dob_field.send_keys(["February", "17", "1986"])

In this new driver, that sends the following command to webdriveragent:
POST ...element/31/value

However, based on webdriveragent code, they do support pickers directly, but they expect the following route:
[[FBRoute POST:@"/uiaElement/:id/value"]

Webdriveragent also supports many other nice new XCUITest behaviors like scrolling with this same route convention.

I'm not positive exactly where /uiaElement/ comes from. I'm thinking it's an "extension" they added to extend the Selenium spec to support these additional commands.

My question / issue is, how to best support this in Appium? My initial answer is, to leverage the "mobile: " commands the same way those used to be used, and any time there is "mobile: " in front, to hit the /uiaElement/ endpoint instead of /element/ endpoint.

What does everyone think?

execute_script to execute UIATarget?

This most likely isn't an issue with this driver, but figured the experts could clarify.

WIth UI Automation and Appium, we could get iOS properties from the UIATarget and adding it to the driver, like this:
self.driver.execute_script('target=UIATarget.localTarget(); [target.name(), target.model(), target.systemName(), target.systemVersion()]')

Do you know if there is something replaceable when using XCUITest?

Driver agent launching fails with 'RoutingHTTPServer/RoutingHTTPServer.h' file not found

I tried to run the driver on device as per the steps provided . But I keep seeing the following error , Also attached the log and the certificate and provisional profile are set to the project .
Let me know for more information
Log.pdf

Testing failed:
'RoutingHTTPServer/RoutingHTTPServer.h' file not found
** TEST FAILED **

The following build commands failed:
CompileC /Users/gangadhar/Library/Developer/Xcode/DerivedData/WebDriverAgent-dusrdxwfwjhxrxdzpfrhnrdhsnbi/Build/Intermediates/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentLib.build/Objects-normal/armv7/FBHTTPOverUSBServer.o WebDriverAgentLib/Routing/FBHTTPOverUSBServer.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

delete_app not working on iOS simulator

We are trying:

self.driver.remove_app("com.onerx.OneRx")

But we get error:

  test_welcome_screen.py line 108 in test_welcome_screen_close
      self.driver.remove_app("com.onerx.OneRx")
    /usr/local/lib/python2.7/site-packages/appium/webdriver/webdriver.py line 523 in remove_app
      self.execute(Command.REMOVE_APP, data)
    /usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py line 201 in execute
      self.error_handler.check_response(response)
    /usr/local/lib/python2.7/site-packages/appium/webdriver/errorhandler.py line 24 in check_response
      super(MobileErrorHandler, self).check_response(response)
    /usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py line 102 in check_response
      value = json.loads(value_json)
    /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py line 339 in loads
      return _default_decoder.decode(s)
    /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py line 364 in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py line 382 in raw_decode
      raise ValueError("No JSON object could be decoded")
   ValueError: No JSON object could be decoded

And the server log suggests:

info JSONWP Proxy Got response with status 200: {"value":"Unhandled endpoint: /session/061C82FF-28B4-4A1F-B00A-914112ED6F10/appium/device/remove_app -- http://localhost:8100/ with parameters {\n    wildcards =     (\n        \"session/061C82FF-2...

I was thinking this means, it's a command that ought to be handled by appium itself but instead is proxied through to WebDriverAgent?

Test fails with simctl error

Hi, I'm trying appium-xcuitest-driver with python-client.
Test fails with an error [Error: simctl error running 'create': Invalid runtime: undefined] but I can't figure out what's wrong. I just cloned this repository and installed it using npm.

info HTTP <-- POST /wd/hub/session 500 169 ms - 194 
info HTTP --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"iPhone 6","app":"XXXXXX.app","platformName":"iOS","autoAcceptAlerts":true,"processArguments":{"environment":{"foo":"BAR"},"arguments":[]}}}
info MJSONWP Calling XCUITestDriver.createSession() with args: [{"deviceName":"iPhone 6","...
info BaseDriver Session created with session id: 284d671f-6e64-4d20-8d87-4f9955cf5014
info XCUITest Simluator udid not provided, using desired caps to create a new simulator
ERR! simctl Error: simctl error running 'create': Invalid runtime: undefined
ERR! simctl     at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
ERR! simctl     at simCommand$ (lib/simctl.js:22:11)
ERR! simctl     at tryCatch (/.../appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! simctl     at GeneratorFunctionPrototype.invoke [as _invoke] (/.../appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:315:22)
ERR! simctl     at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/.../appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:100:21)
ERR! simctl     at GeneratorFunctionPrototype.invoke (/.../appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:136:37)
ERR! simctl     at run (/.../appium-xcuitest-driver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:108:47)
ERR! simctl     at /.../appium-xcuitest-driver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:119:28
ERR! simctl     at flush (/.../appium-xcuitest-driver/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
ERR! simctl     at nextTickCallbackWith0Args (node.js:420:9)
ERR! simctl     at process._tickCallback (node.js:349:13)
ERR! simctl  [Error: simctl error running 'create': Invalid runtime: undefined]

xcodebuild failed with code 70

I have built and ran appium-xcuitest-driver in the past, but pulled the lastest bits from master and getting an xcodebuild error.

I was able to clone WDA, and build through xcode
I was able to take the command from the driver logs and run it manually, but when kicking off an apoium session, xcodebuild fails

[iOSSim] Simulator booted in 19682ms
[XCUITest] Using default agent: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Beginning test with command 'xcodebuild -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=BD897B5C-90C8-4A4D-9916-DDB7EC0DEDEF test' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[XCUITest] xcodebuild exited with code '70' and signal 'null'
[XCUITest] Error: xcodebuild failed with code 70
    at SubProcess.<anonymous> (lib/webdriveragent.js:214:25)
    at emitTwo (events.js:106:13)
    at SubProcess.emit (events.js:191:7)
    at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
 Error: xcodebuild failed with code 70
    at SubProcess.<anonymous> (lib/webdriveragent.js:214:25)
    at emitTwo (events.js:106:13)
    at SubProcess.emit (events.js:191:7)
    at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
[XCUITest] Shutting down WebDriverAgent
[XCUITest] Simulator log exited with code 'null'
[debug] [XCUITest] Resetting simulator
[debug] [XCUITest] Shutting down simulator
[debug] [iOSSim] Killing all iOS Simulators
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: xcodebuild failed with code 70
    at SubProcess.<anonymous> (lib/webdriveragent.js:214:25)
    at emitTwo (events.js:106:13)
    at SubProcess.emit (events.js:191:7)
    at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
[HTTP] <-- POST /wd/hub/session 500 2

Collection cells - finding and counting elements issues

Hello,

I've encountered 3 issues when testing collection views:

  1. findElements(By.className("UIACollectionCell")).get(0) does not always return the first displayed cell - seems to work on iPad (I think it has to do with the fact that iPad can display more elements on screen) and not on iPhone
  2. findElements(By.className("UIACollectionCell")).size() does not return the appropriate number of elements - it appears to always return 4 on iPhone simulator and 5 on iPad simulator
  3. findElements(By.xpath("//UIACollectionCell/UIAStaticText[name='someName']")).size()does not return the expected number of elements - for eg: I am expecting 1 and it returns 2 (I am switching from one collection to another by Segmented Control)

All the above cases work fine in Appium v. 1.5.2.

Some more info:

  • xcuitest release 1.0.2.
  • Selenium-java version: 2.53.0
  • Java-client version: 3.4.1

If you need some more information, please let me know.

Regards,
Anna

integration with FBSimulatorControl

Not an issue, but more of a question on if this driver will have some integrations with FBSimulatorControl? I know WebDriverAgent and it are buddy buddies, so wondering if there are plans for a capabilities setting to use it, or allow appium to use an already booted simulator?

Thanks

Clicking element results in test crashing

Hey, Im kinda thinking this is a XCUITest bug, but wanted to know if any of you have ran into the same issue.

So when executing some commands on a iphone 6 v9.2 simulator, after one click that updates the nav menu of our app, all the element on the menu are still "visible and enabled" but when you try to click on of them, the driver takes awhile but then crashes, which in turns closes our app.

Now a weird things about it is if I manually intervene with the menu while the driver is trying to click, it will work. :/

There are now errors in the driver console. just this.

info MJSONWP Driver proxy active, passing request on via HTTP proxy
info JSONWP Proxy Proxying [GET /wd/hub/session/dd9836fc-d8c2-46c5-8cad-4ecd37c3020a/element/41/text] to [GET http://localhost:8100/session/2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57/element/41/text] with body: {}
info JSONWP Proxy Got response with status 200: "{\n  \"value\" : \"Mens Varsity Basketball\",\n  \"sessionId\" : \"2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57\",\n  \"status\" : 0\n}"
info JSONWP Proxy Replacing sessionId 2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57 with dd9836fc-d8c2-46c5-8cad-4ecd37c3020a
info HTTP <-- GET /wd/hub/session/dd9836fc-d8c2-46c5-8cad-4ecd37c3020a/element/41/text 200 54.734 ms - 97
info HTTP --> POST /wd/hub/session/dd9836fc-d8c2-46c5-8cad-4ecd37c3020a/element/41/click
info MJSONWP Driver proxy active, passing request on via HTTP proxy
info JSONWP Proxy Proxying [POST /wd/hub/session/dd9836fc-d8c2-46c5-8cad-4ecd37c3020a/element/41/click] to [POST http://localhost:8100/session/2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57/element/41/click] with body: {"id":41,"sessionId":"dd9836fc-d8c2-46c5-8cad-4ecd37c3020a"}
info JSONWP Proxy Got response with status 200: {"status":0,"id":41,"value":"","sessionId":"2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57"}
info JSONWP Proxy Replacing sessionId 2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57 with dd9836fc-d8c2-46c5-8cad-4ecd37c3020a
info HTTP <-- POST /wd/hub/session/dd9836fc-d8c2-46c5-8cad-4ecd37c3020a/element/41/click 200 5848.169 ms - 82
info HTTP --> POST /wd/hub/session/dd9836fc-d8c2-46c5-8cad-4ecd37c3020a/element/41/click
info MJSONWP Driver proxy active, passing request on via HTTP proxy
info JSONWP Proxy Proxying [POST /wd/hub/session/dd9836fc-d8c2-46c5-8cad-4ecd37c3020a/element/41/click] to [POST http://localhost:8100/session/2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57/element/41/click] with body: {"id":41,"sessionId":"dd9836fc-d8c2-46c5-8cad-4ecd37c3020a"}
info JSONWP Proxy Got response with status 200: {"value":"Interrupting test","sessionId":"2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57","status":13}
info JSONWP Proxy Replacing sessionId 2F3EB064-15FA-4DE4-8FFA-37BF7B4FDA57 with dd9836fc-d8c2-46c5-8cad-4ecd37c3020a
info HTTP <-- POST /wd/hub/session/dd9836fc-d8c2-46c5-8cad-4ecd37c3020a/element/41/click 200 30246.698 ms - 92
info WebDriverAgent-driver xcodebuild exited with code 65 and signal null

Access camera modal?

Has anybody has into after clicking an element and an access camera alert, the driver does not continue onto the next step? The app shuts down but the alert stays on the screen.

It kind of seems like the initial click that prompts the alert is not being registered as successful.

Normally, we would click into the camera section, the alert would show, and we would accept the alert if present. This is with the python client.

alert.accept() returns NoSuchElementException instead of NoAlertPresentException

When using appium with the java client, attempting to accept/dismiss an alert when there is no alert present should throw a NoAlertPresentException, but instead a NoSuchElementException is thrown.

It works properly with appium-ios-driver, so the bug is (probably) in appium-xcuitest-driver and not in the java client.

getting list of contexts is no longer working

Hi, I am trying to list available contexts (it should have native_app, a UIWebview and a WKWebview), however, I was hitting errors as below:

info MJSONWP Calling XCUITestDriver.getContexts() with args: ["6c7e9549-324e-40f5-8570-7...
dbug XCUITest Executing command 'getContexts'
dbug iOS Getting list of available contexts
dbug iOS Retrieving contexts and views
dbug iOS Selecting by url: false
dbug RemoteDebugger useNewSafari --> false
dbug RemoteDebugger Debugger socket connected to ::1:27753
dbug RemoteDebugger Sending connection key request
dbug RemoteDebugger Sending '_rpc_reportIdentifier:' message to remote debugger
dbug RemoteDebugger Receiving data from remote debugger: '{"__argument":{"WIRSimulatorBuildKey":"13E230","WIRSimulatorProductVersionKey":"9.3","WIRSimulatorNameKey":"iPhone"},"__selector":"_rpc_reportSetup:"}'
dbug RemoteDebugger Received response from socket send: '["iPhone","13E230","9.3"]'
dbug RemoteDebugger Sim name: iPhone
dbug RemoteDebugger Sim build: 13E230
dbug RemoteDebugger Sim platform version: 9.3
dbug RemoteDebugger Receiving data from remote debugger: '{"__argument":{"WIRApplicationDictionaryKey":{"PID:61366":{"WIRApplicationIdentifierKey":"PID:61366","WIRIsApplicationProxyKey":false,"WIRApplicationNameKey":"Salesforce1","WIRApplicationBundleIdentifierKey":"com.salesforce.internal.chatter2","WIRIsApplicationActiveKey":1},"PID:61368":{"WIRApplicationIdentifierKey":"PID:61368","WIRIsApplicationProxyKey":true,"WIRApplicationNameKey":"","WIRApplicationBundleIdentifierKey":"com.apple.WebKit.WebContent","WIRIsApplicationActiveKey":1,"WIRHostApplicationIdentifierKey":"PID:61366"}}},"__selector":"_rpc_reportConnectedApplicationList:"}'
dbug RemoteDebugger Connected to application
dbug RemoteDebugger Selecting application
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
ERR! RemoteDebugger Error: Could not connect to a valid app after 20 tries.
ERR! RemoteDebugger at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
ERR! RemoteDebugger at RemoteDebugger.selectApp$ (lib/remote-debugger.js:231:11)
ERR! RemoteDebugger at tryCatch (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! RemoteDebugger at GeneratorFunctionPrototype.invoke as _invoke
ERR! RemoteDebugger at GeneratorFunctionPrototype.prototype.(anonymous function) as next
ERR! RemoteDebugger at invoke (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:136:37)
ERR! RemoteDebugger at enqueueResult (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:185:17)
ERR! RemoteDebugger at new Promise (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/core-js/library/modules/es6.promise.js:201:7)
ERR! RemoteDebugger at AsyncIterator.enqueue (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:184:12)
ERR! RemoteDebugger at AsyncIterator.prototype.(anonymous function) as next
ERR! RemoteDebugger at Object.runtime.async (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:209:12)
ERR! RemoteDebugger at RemoteDebugger.selectApp (lib/remote-debugger.js:261:21)
ERR! RemoteDebugger at XCUITestDriver.callee$0$0$ (lib/commands/context.js:208:35)
ERR! RemoteDebugger at tryCatch (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! RemoteDebugger at GeneratorFunctionPrototype.invoke as _invoke
ERR! RemoteDebugger at GeneratorFunctionPrototype.prototype.(anonymous function) as next
ERR! RemoteDebugger at GeneratorFunctionPrototype.invoke (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:136:37)
ERR! RemoteDebugger at run (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/core-js/library/modules/es6.promise.js:108:47)
ERR! RemoteDebugger at /Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/core-js/library/modules/es6.promise.js:119:28
ERR! RemoteDebugger at flush (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/core-js/library/modules/$.microtask.js:19:5)
ERR! RemoteDebugger at nextTickCallbackWith0Args (node.js:452:9)
ERR! RemoteDebugger at process._tickCallback (node.js:381:13)
ERR! RemoteDebugger [Error: Could not connect to a valid app after 20 tries.]

And today, I got latest code and try to list all contexts, it's showing me "undefined method `contexts' for #Appium::Driver:0x007f7fc8ac8f38 (NoMethodError)"

So what's the right way to list all the contexts now and how shall I switch to the WKWebview context... Thanks for advice!

Issue setting up XCUITest Driver

Hello,

I am trying to use the new XCUITest driver to see if it will help with an issue I am having running Appium with one of my apps. I have explained my situation it in detail here
https://discuss.appium.io/t/webdriveragent-shuts-down-when-trying-to-use-appium-xcuitest-driver/9270

Basically, whenever I try to run my tests with the XCUITest Driver my tests crash when I try to create a new iOSDriver. The logs of which I have included at the bottom of this post

Something I think may be causing it, I have noticed something weird going on with the current version of the WebDriverAgent in the appium-xcuitest-driver. I downloaded appium-xcuitest-driver version 1.0.1 and could not get the WebDriverAgent to even launch. However, if I used 1.0.0 I was able to get it to launch with the same error shown below.

image

Support hideKeyboard() action

Hi,

Right now the appium-specific command "hideKeyboard(strategy, ...possibleKeys)" is not supported (unless I'm confused).

I was able to get a simple version of it working, in combination with some WebDriverAgent changes, as follows:
Appium: capture the request by adding a proxy avoid list item: ['POST', /appium/], and don't proxy it.
Then implement code to call a new WDA route I made.

WebDriverAgent: Implement a new route like this:

    [[FBRoute POST:@"/hide_keyboard"] respond: ^ id<FBResponsePayload> (FBRouteRequest *request) {
        FBXCTSession *session = (FBXCTSession *)request.session;
        [[session.application.windows elementAtIndex:0] tap];
      return FBResponseDictionaryWithOK();
    }],

This worked, so it satisfied me that it seems to be possible. But before I did anything further I wanted to see what the community thought as to the best implementation. Additionally, I wasn't sure what the intention of possibleKeys was. I think I understand the various strategies, but if I actually implement this I think it would be helpful to have more info on each of the desired strategies.

Thanks!

scrollIntoView before click sometimes causes error

Sometimes when clicking on an element, I receive the following errors"
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Failed to perform scroll with visible cell count 0" UserInfo={NSLocalizedDescription=Failed to perform scroll with visible cell count 0}

From looking at the WDA code, it seems that scrolling to visible cell only works if the cell is inside a ScrollView, CollectionView or Table.

I also tried debugging the function scrollIntoView and it seems that if there's any error, mobileScroll throws an exception instead of returning the http response. The following line (and the code after it):
if (response && response.status !== 0 && response.value && response.value.indexOf("Failed to perform scroll") > -1) {
will not be reached in this case.

Current window size returning 500

Im using the python client, but when getting the current window size, its saying this method should be proxied to WDA. I was looking through the Roadmap #53 and looks like windows size was account for? Is this an driver issue or python-client issue?

self.driver.get_window_size()
info HTTP --> GET /wd/hub/session/59da29fe-4333-4e69-8b16-add045c69c02/window/current/size {}
info MJSONWP Calling XCUITestDriver.getWindowSize() with args: ["current","59da29fe-4333-4...
dbug XCUITest Executing command 'getWindowSize'
info HTTP <-- GET /wd/hub/session/59da29fe-4333-4e69-8b16-add045c69c02/window/current/size 500

Error: The following capabilities were provided, but are not recognized by appium: app

I think this is the root cause of the error but I'm seeing a few others in there which may also be relevant:

"The following capabilities were provided, but are not recognized by appium: app"

"xcodebuild exited with code 70 and signal null"

"Encountered internal error running command: TypeError: Cannot set property 'sessionId' of undefined'

If you need more of the logs let me know.

Can't start WebDriverAgent when connected to company VPN

Im seeing an issue when connected to company vpn Im not able to start the WebDriverAgent/

In /lib/webdriveragent.js,
this.jwproxy = new JWProxy({server: this.url.hostname, port: this.url.port, base: ''});
this.url.hostname get the the IP address instead of the localhost, that failed to start the WebDriverAgent.

I have hard coded the server to 'localhost' to solve this issue, but there should be a better way to solve this.

WebDriverAgent process did not end in a timely fashion. Sending SIGHUP signal

info XCUITest Waiting for WebDriverAgent to start on device
dbug XCUITest Log file for xcodebuild test: /Users/ucar/Library/Developer/Xcode/DerivedData/WebDriverAgent-gpotvrjsfahdcifdswagnrceyloh/Logs/Test/F0162D0B-881B-45C8-92DA-5ED9BC2D034A/Session-2016-09-01_12:38:16-Avdsuc.log
info XCUITest xcodebuild exited with code '65' and signal 'null'
dbug XCUITest xcodebuild failure warrants retry. Retrying...
info XCUITest Shutting down WebDriverAgent
dbug XCUITest WebDriverAgent process did not end in a timely fashion. Sending SIGHUP signal...
ERR! XCUITest Error: Process didn't end after 10000ms
ERR! XCUITest     at Timeout._onTimeout (lib/teen_process.js:234:16)
ERR! XCUITest     at tryOnTimeout (timers.js:228:11)
ERR! XCUITest     at Timer.listOnTimeout (timers.js:202:5)
ERR! XCUITest  Error: Process didn't end after 10000ms
ERR! XCUITest     at Timeout._onTimeout (lib/teen_process.js:234:16)
ERR! XCUITest     at tryOnTimeout (timers.js:228:11)
ERR! XCUITest     at Timer.listOnTimeout (timers.js:202:5)
info XCUITest Shutting down WebDriverAgent
dbug XCUITest WebDriverAgent process did not end in a timely fashion. Sending SIGHUP signal...
ERR! MJSONWP Encountered internal error running command: Error: Process didn't end after 10000ms
ERR! MJSONWP     at Timeout._onTimeout (lib/teen_process.js:234:16)
ERR! MJSONWP     at tryOnTimeout (timers.js:228:11)
ERR! MJSONWP     at Timer.listOnTimeout (timers.js:202:5)
info HTTP <-- POST /wd/hub/session 500 47651 ms - 169

what's the reason? pls help me....

wd/hub/status is not implemented, returns 501 code

I'm trying to connect to the XCUITest driver (commit e39444d on Node 6.1.0) through the Appium Java client (3.4.1).

Right off the bat, the driver spews out this in the console:

info MJSONWP Calling WebDriverAgentDriver.getStatus() with args: []
info HTTP <-- GET /wd/hub/status 501 1 ms - 88
info HTTP --> GET /wd/hub/status {}
info MJSONWP Calling WebDriverAgentDriver.getStatus() with args: []
info HTTP <-- GET /wd/hub/status 501 1 ms - 88
info HTTP --> GET /wd/hub/status {}
info MJSONWP Calling WebDriverAgentDriver.getStatus() with args: []
info HTTP <-- GET /wd/hub/status 501 1 ms - 88
info HTTP --> GET /wd/hub/status {}

What's happening is the Java client is pinging the server before attempting to start a session. This is reasonable behavior, I think. But it seems the driver hasn't implemented this endpoint.

My app crash with 1.6 beta appium & iOS 10

I installed the 1.6 beta for test ios10 with iPhone 6S simulator (Xcode 8 beta 6). When I try to launch test App crash.

[Appium] Welcome to Appium v1.6.0-beta1 (REV 7e3c0fe76d3be345aa89c742b1ae05cbbf79caa9)
[Appium] Non-default server args:
[Appium]   address: 'localhost'
[Appium]   port: 3723
[Appium]   defaultCapabilities: { udid: '91775F3C-0041-452D-97CA-8A1D76D198F6',
  automationName: 'XCUITest',
  logXcodeOutput: true }
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium]   udid: '91775F3C-0041-452D-97CA-8A1D76D198F6'
[Appium]   automationName: 'XCUITest'
[Appium]   logXcodeOutput: true
[Appium] Appium REST http interface listener started on localhost:3723










[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/romainlouvet/Downloads/Leboncoin.ipa","browserName":"","waitForAppScript":"$.delay(2000); $.acceptAlert();","platformName":"iOS","version":"8.0.2","deviceName":"iPhoneLocal"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/romainlouve...
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium]   app: '/Users/romainlouvet/Downloads/Leboncoin.ipa'
[Appium]   browserName: ''
[Appium]   waitForAppScript: '$.delay(2000); $.acceptAlert();'
[Appium]   platformName: 'iOS'
[Appium]   version: '8.0.2'
[Appium]   deviceName: 'iPhoneLocal'
[Appium]   udid: '91775F3C-0041-452D-97CA-8A1D76D198F6'
[Appium]   automationName: 'XCUITest'
[Appium]   logXcodeOutput: true
[BaseDriver] The following capabilities were provided, but are not recognized by appium: version, logXcodeOutput.
[BaseDriver] Session created with session id: 69a41bb1-349b-496d-b3e7-6173adf17b50
[debug] [XCUITest] Xcode version set to '8.0'
[debug] [XCUITest] iOS SDK Version set to '10.0'
[iOSSim] Constructing iOS simulator for Xcode version 8.0 with udid '91775F3C-0041-452D-97CA-8A1D76D198F6'
[XCUITest] Determining device to run tests on: udid: '91775F3C-0041-452D-97CA-8A1D76D198F6', real device: false
[XCUITest] No platformVersion specified. Using device version: '10.0'
[BaseDriver] Using local app '/Users/romainlouvet/Downloads/Leboncoin.ipa'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/83/643lpjl10bbd8h975r2b8k_h0000gn/T/2016813-8904-1hrmfdh.irv34n29/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/83/643lpjl10bbd8h975r2b8k_h0000gn/T/2016813-8904-1hrmfdh.irv34n29/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/83/643lpjl10bbd8h975r2b8k_h0000gn/T/2016813-8904-1hrmfdh.irv34n29/Payload/Leboncoin.app'
[debug] [XCUITest] Checking whether app is actually present
[debug] [ios-app-utils] Getting bundle ID from app
[debug] [iOSLog] Starting iOS 10.0 simulator log capture
[debug] [iOSLog] System log path: /Users/romainlouvet/Library/Logs/CoreSimulator/91775F3C-0041-452D-97CA-8A1D76D198F6/system.log
[XCUITest] Setting up simulator
[debug] [iOS] No reason to set locale
[debug] [iOS] No iOS / app preferences to set
[XCUITest] Simulator with udid '91775F3C-0041-452D-97CA-8A1D76D198F6' not booted. Booting up now
[debug] [iOSSim] Killing all iOS Simulators
[iOSSim] Starting simulator with command: open /Users/romainlouvet/Downloads/Xcode-beta.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID 91775F3C-0041-452D-97CA-8A1D76D198F6
[iOSSim] Tailing simulator logs until we encounter the string "SMS Plugin initialized"
[iOSSim] We will time out after 60000ms
[debug] [iOSSim] Waiting an extra 10000ms for the simulator to really finish booting
[debug] [iOSSim] Done waiting extra time for simulator
[iOSSim] Simulator booted in 19519ms
[XCUITest] Using default agent: /Users/romainlouvet/Documents/workspace/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /Users/romainlouvet/Documents/workspace/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Beginning test with command 'xcodebuild -project /Users/romainlouvet/Documents/workspace/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=91775F3C-0041-452D-97CA-8A1D76D198F6 build test' in directory '/Users/romainlouvet/Documents/workspace/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Logs/Test/30B44BCC-ACEB-4999-8B66-C52B67763F09/Session-WebDriverAgentRunner-2016-09-13_162257-nNk7uX.log
[debug] [WebDriverAgent] Sim: Sep 13 16:23:00 Romains-MacBook-Pro CoreSimulatorBridge[8951]: Requesting installation of file:///Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app/ with options: {
[debug] [WebDriverAgent] Sim:       CFBundleIdentifier = "com.apple.test.WebDriverAgentRunner-Runner";
[debug] [WebDriverAgent] Sim:       PackageType = Developer;
[debug] [WebDriverAgent] Sim:       SimulatorRootPath = "/Users/romainlouvet/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk";
[debug] [WebDriverAgent] Sim:       SimulatorUserPath = "/Users/romainlouvet/Library/Developer/CoreSimulator/Devices/91775F3C-0041-452D-97CA-8A1D76D198F6/data";
[debug] [WebDriverAgent] Sim:   }
[debug] [WebDriverAgent] Sim: Sep 13 16:23:00 Romains-MacBook-Pro CoreSimulatorBridge[8951]: Getting container class internal daemon!
[debug] [WebDriverAgent] Sim: Sep 13 16:23:04 Romains-MacBook-Pro CoreSimulatorBridge[8951]: Requesting launch of com.apple.test.WebDriverAgentRunner-Runner with options: {
[debug] [WebDriverAgent] Sim:       arguments =     (
[debug] [WebDriverAgent] Sim:           "-NSTreatUnknownArgumentsAsOpen",
[debug] [WebDriverAgent] Sim:           NO,
[debug] [WebDriverAgent] Sim:           "-ApplePersistenceIgnoreState",
[debug] [WebDriverAgent] Sim:           YES
[debug] [WebDriverAgent] Sim:       );
[debug] [WebDriverAgent] Sim:       environment =     {
[debug] [WebDriverAgent] Sim:           "DTX_CONNECTION_SERVICES_PATH" = "/Users/romainlouvet/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Developer/Library/PrivateFrameworks/DTXConnectionServices.framework";
[debug] [WebDriverAgent] Sim:           "DYLD_FRAMEWORK_PATH" = "/Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Build/Products/Debug-iphonesimulator:/Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Build/Products/Debug-iphonesimulator:/Users/romainlouvet/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks";
[debug] [WebDriverAgent] Sim:           "DYLD_LIBRARY_PATH" = "/Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Build/Products/Debug-iphonesimulator:/Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Build/Products/Debug-iphonesimulator:/Users/romainlouvet/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks";
[debug] [WebDriverAgent] Sim:           NSUnbufferedIO = YES;
[debug] [WebDriverAgent] Sim:           "OS_ACTIVITY_DT_MODE" = YES;
[debug] [WebDriverAgent] Sim:           "XCODE_DBG_XPC_EXCLUSIONS" = "com.apple.dt.xctestSymbolicator";
[debug] [WebDriverAgent] Sim:           XCTestConfigurationFilePath = "/var/folders/83/643lpjl10bbd8h975r2b8k_h0000gn/T/com.apple.dt.XCTest/EEC7E3B9-7B69-45CA-B8F8-0F11DECFE851/remote-container/tmp/WebDriverAgentRunner-EEC7E3B9-7B69-45CA-B8F8-0F11DECFE851.xctestconfiguration";
[debug] [WebDriverAgent] Sim:           "__XCODE_BUILT_PRODUCTS_DIR_PATHS" = "/Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Build/Products/Debug-iphonesimulator";
[debug] [WebDriverAgent] Sim:           "__XPC_DYLD_FRAMEWORK_PATH" = "/Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Build/Products/Debug-iphonesimulator";
[debug] [WebDriverAgent] Sim:           "__XPC_DYLD_LIBRARY_PATH" = "/Users/romainlouvet/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhddbhhblwqbekgxjrgrshemsgsy/Build/Products/Debug-iphonesimulator";
[debug] [WebDriverAgent] Sim:       };
[debug] [WebDriverAgent] Sim:       stderr = "/dev/ttys004";
[debug] [WebDriverAgent] Sim:       stdout = "/dev/ttys004";
[debug] [WebDriverAgent] Sim:       "wait_for_debugger" = 0;
[debug] [WebDriverAgent] Sim:   }
[debug] [WebDriverAgent] Sim: Sep 13 16:23:04 Romains-MacBook-Pro CoreSimulatorBridge[8951]: [Common] [FBSSystemService][0x6ca2] Sending request to open "com.apple.test.WebDriverAgentRunner-Runner"
[debug] [WebDriverAgent] Sim: Sep 13 16:23:04 Romains-MacBook-Pro CoreSimulatorBridge[8951]: [Common] [FBSSystemService][0x6ca2] Request successful: <FBSProcessHandle: 0x7fa233f0c950; XCTRunner:9258; valid: YES>
[debug] [WebDriverAgent] Sim: Sep 13 16:23:04 Romains-MacBook-Pro XCTRunner[9258]: assertion failed: 15G1004 14A5339a: libxpc.dylib + 62597 [37A9DF49-35C1-3D93-B854-B35CACF0100F]: 0x7d
[debug] [WebDriverAgent] Sim: Sep 13 16:23:05 Romains-MacBook-Pro XCTRunner[9258]: Running tests...
[debug] [WebDriverAgent] Sim: Sep 13 16:23:06 --- last message repeated 3 times ---
[debug] [WebDriverAgent] Sim: Sep 13 16:23:06 Romains-MacBook-Pro XCTRunner[9258]: Continuing to run tests in the background with task ID 1
[debug] [WebDriverAgent] Sim: Sep 13 16:23:07 --- last message repeated 12 times ---
[debug] [WebDriverAgent] Sim: Sep 13 16:23:07 Romains-MacBook-Pro XCTRunner[9258]: Built at Sep 13 2016 16:22:58
[XCUITest] Detected that WebDriverAgent is running at url 'http://192.168.153.59:8100'
[debug] [WebDriverAgent] Sim: Sep 13 16:23:07 Romains-MacBook-Pro XCTRunner[9258]: ServerURLHere->http://192.168.153.59:8100<-ServerURLHere
[XCUITest] WebDriverAgent started at url 'http://192.168.153.59:8100'
[JSONWP Proxy] Proxying [POST /session] to [POST http://192.168.153.59:8100/session] with body: {"desiredCapabilities":{"bu...
[debug] [WebDriverAgent] Sim: Sep 13 16:23:07 Romains-MacBook-Pro XCTRunner[9258]: Listening on USB
[debug] [WebDriverAgent] Sim: Sep 13 16:23:07 Romains-MacBook-Pro assertiond[8946]: Could not create or rename power assertion for <BKNewProcess: 0x7f865370e920; com.apple.test.WebDriverAgentRunner-Runner; pid: 9258; hostpid: -1>: 0xe00002c9
[debug] [WebDriverAgent] Sim: Sep 13 16:23:07 Romains-MacBook-Pro SpringBoard[8942]: [KeyboardArbiter] HW kbd: Failed to set (null) as keyboard focus

setValue not working - WDA expects array of chars, not string

When using setValue with a simple string (no special keys), the following errors occurs:
An unknown server-side error occurred while processing the command. Original error: -[__NSCFString componentsJoinedByString:]: unrecognized selector sent to instance 0x146890d40

This happens because element.js sends the value as a string, while WDA expects an array of chars (FBElementsCommands.m:154):
NSString *textToType = [value componentsJoinedByString:@""];

Do we need to signature webdriveragent by using appium-xcuitest-driver?

Hi all,
when i run testing with appium-xcuitest-driver, i get the following error:

**The following build commands failed:
CodeSign /Users/ucar/Library/Developer/Xcode/DerivedData/WebDriverAgent-ecncypxshfwjehdvedwmpomonice/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework
CodeSign /Users/ucar/Library/Developer/Xcode/DerivedData/WebDriverAgent-ecncypxshfwjehdvedwmpomonice/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/Frameworks/KissXML.framework
CodeSign /Users/ucar/Library/Developer/Xcode/DerivedData/WebDriverAgent-ecncypxshfwjehdvedwmpomonice/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/Frameworks/Peertalk.framework
(3 failures)

xctest-client.js:163:14 [master] pid:3200 xctest client exit with code: 65, signal: null**

anyone can help me? thanks

Special key not handled anymore

Not sure if this issue belongs to WDA. When sending special key to textfield, such as Enter, it got translated to emoji:

screen shot 2016-08-30 at 11 46 53 am

[JSONWP Proxy] Got response with status 200: {"value":[{"ELEMENT":"355A9...
[MJSONWP] Responding to client with driver.findElements() result: [{"ELEMENT":"355A97BC-262F-...
[HTTP] <-- POST /wd/hub/session/3942274d-cf2e-4a98-8949-7d521924d44b/elements 200 4964 ms - 173
[HTTP] --> POST /wd/hub/session/3942274d-cf2e-4a98-8949-7d521924d44b/element/355A97BC-262F-491D-BF33-508A0474F2D2/value {"value":["disney book"]}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[JSONWP Proxy] Proxying [POST /wd/hub/session/3942274d-cf2e-4a98-8949-7d521924d44b/element/355A97BC-262F-491D-BF33-508A0474F2D2/value] to [POST http://172.29.236.238:8100/session/73882F99-ED7C-440B-AC81-F1E5A74FE346/element/355A97BC-262F-491D-BF33-508A0474F2D2/value] with body: {"value":["disney book"]}
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading...
[JSONWP Proxy] Got response with status 200: {"status":0,"id":"355A97BC-...
[JSONWP Proxy] Replacing sessionId 73882F99-ED7C-440B-AC81-F1E5A74FE346 with 3942274d-cf2e-4a98-8949-7d521924d44b
[HTTP] <-- POST /wd/hub/session/3942274d-cf2e-4a98-8949-7d521924d44b/element/355A97BC-262F-491D-BF33-508A0474F2D2/value 200 1061 ms - 118
[HTTP] --> POST /wd/hub/session/3942274d-cf2e-4a98-8949-7d521924d44b/keys {"value":[""]}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[JSONWP Proxy] Proxying [POST /wd/hub/session/3942274d-cf2e-4a98-8949-7d521924d44b/keys] to [POST http://172.29.236.238:8100/session/73882F99-ED7C-440B-AC81-F1E5A74FE346/keys] with body: {"value":[""]}
[JSONWP Proxy] Got response with status 200: {"value":{},"sessionId":"73...
[JSONWP Proxy] Replacing sessionId 73882F99-ED7C-440B-AC81-F1E5A74FE346 with 3942274d-cf2e-4a98-8949-7d521924d44b
[HTTP] <-- POST /wd/hub/session/3942274d-cf2e-4a98-8949-7d521924d44b/keys 200 637 ms - 74

Safari test requested?

Hi, when I execute, the simulator gets created but automatically opens safari? In the logs it looks like the safari test was requested but I didn't request it. Is there was way to turn this off?

Using the python client, these are my desired caps and command to start the session.

{'app': '/Users/josh.lesch/Library/Developer/Xcode/DerivedData/Example-cjtrsczigiznjseugfepdeoohtvo/Build/Products/Debug-iphonesimulator/Example.app', 'browserName': 'iPad 2', 'platformVersion': '8.4', 'deviceName': 'iPad 2', 'platformName': 'iOS', 'version': '8.4', 'newCommandTimeout': 1800}

self.driver = webdriver.Remote("http://localhost:4723/wd/hub", caps)

info WebDriverAgent-driver WebDriverAgent server listening on http://localhost:4723
info HTTP --> POST /wd/hub/session
info MJSONWP Calling WebDriverAgentDriver.createSession() with args: [{"browserName":"iPad 2","platformName":"iOS","deviceName":"iPad 2","newCommandTimeout":1800,"platformVersion":"8.4","app":"/Users/josh.lesch/Libra...
WARN BaseDriver The following capabilities were provided, but are not recognized by appium: browserName, app, version.
info BaseDriver Session created with session id: 7b9d817a-1276-454b-8b18-abff5ae9b34f
info WebDriverAgent-driver Determining device to run tests on
info WebDriverAgent-driver udid not provided, using desired caps to create a new sim
info simctl Executing: xcrun with args: simctl create appiumTest-7b9d817a-1276-454b-8b18-abff5ae9b34f iPad 2 8.4 and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
dbug Support Attempting to parse plist file '/Applications/Xcode.app/Contents/Info.plist'
dbug Support Parsed plist file as binary
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info iOSSim Constructing iOS simulator for Xcode version 7.2
info WebDriverAgent-driver created simulator 76D36E5F-DDC4-4289-B392-C2CD6014B711. Booting it up
info WebDriverAgent-driver safari test requested
dbug WebDriverAgent-driver Checking whether app is actually present
info WebDriverAgent-driver setting up simulator
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info iOSSim Constructing iOS simulator for Xcode version 7.2
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info iOSSim Constructing iOS simulator for Xcode version 7.2
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info WebDriverAgent-driver simulator with udid 76D36E5F-DDC4-4289-B392-C2CD6014B711 not booted. Booting up now
dbug iOSSim Killing all iOS Simulators
info iOSSim Starting simulator with command: open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID 76D36E5F-DDC4-4289-B392-C2CD6014B711
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
dbug iOSSim Waiting and extra 2000ms for the simulator to really finish booting
dbug iOSSim Done waiting extra time for simulator
info iOSSim Simulator booted in 3345ms
info simctl Executing: xcrun with args: simctl list devices and timeout: 0
info simctl Executing: xcrun with args: simctl openurl 76D36E5F-DDC4-4289-B392-C2CD6014B711 http://appium.io and timeout: 0
dbug iOSSim Safari started, waiting 3000ms for it to fully start
dbug iOSSim Done waiting for Safari
info MJSONWP Responding to client with driver.createSession() result: {"browserName":"iPad 2","platformName":"iOS","deviceName":"iPad 2","newCommandTimeout":1800,"platformVersion":"8.4","app":"/Users/josh.lesch/Librar...
info HTTP <-- POST /wd/hub/session 200

driver.getPageSource() - wrong tags in returned xml

  • Appium Version: 1.6.0-beta1 (with capability AutomationName XCUITest)
  • java-client: 4.1.2

driver.getPageSource() returns xml with tags without prefix - e.g.:

  • StaticText
  • SegmentedControl

When in reality the tags have XCUIElementType prefix - e.g.:

  • XCUIElementTypeStaticText

Whereas element.getTagName() returns proper tag name (with prefix)

Can't click/tap on keyboard search button when device in landscape mode

Im not sure if this is a known issue, but noticed that when I have my iPad air 2 sim on landscape mode, the click action doesn't work. It works when it in portrait mode.

From the log, it got the element, and http request returns 200.

info MJSONWP Responding to client with driver.findElementFromElement() result: {"ELEMENT":"CE6A1DDF-A33F-4...
info HTTP <-- POST /wd/hub/session/25fc9526-7037-44c1-a3ab-7950ef4864e4/element/E6245DA3-67AB-4A84-BBD5-5D18316F5937/element 200 620 ms - 170 
info HTTP --> POST /wd/hub/session/25fc9526-7037-44c1-a3ab-7950ef4864e4/element/CE6A1DDF-A33F-4191-9FEC-E41B6CD2F454/click {"id":"CE6A1DDF-A33F-4191-9FEC-E41B6CD2F454"}
info MJSONWP Driver proxy active, passing request on via HTTP proxy
info JSONWP Proxy Proxying [POST /wd/hub/session/25fc9526-7037-44c1-a3ab-7950ef4864e4/element/CE6A1DDF-A33F-4191-9FEC-E41B6CD2F454/click] to [POST http://localhost:8100/session/D5541FA5-EC31-4EBB-9464-9E7E7DD60688/element/CE6A1DDF-A33F-4191-9FEC-E41B6CD2F454/click] with body: {"id":"CE6A1DDF-A33F-4191-9FEC-E41B6CD2F454"}
info JSONWP Proxy Got response with status 200: {"status":0,"id":"CE6A1DDF-...
info JSONWP Proxy Replacing sessionId D5541FA5-EC31-4EBB-9464-9E7E7DD60688 with 25fc9526-7037-44c1-a3ab-7950ef4864e4
info HTTP <-- POST /wd/hub/session/25fc9526-7037-44c1-a3ab-7950ef4864e4/element/CE6A1DDF-A33F-4191-9FEC-E41B6CD2F454/click 200 774 ms - 118 

Unhandled endpoint. Work arounds?

HI, i currently understand that xcuitest driver does not recognize the /timeouts endpoint and is responding with an error. But currently my test cases are failing for IOS when i do a reset or close app.. and i know this is an expected action, but i can't seem to find how to work around it.

When using xcuitest driver, should the test case all run in one flow without resetting the application?
I would love to see some examples but i really can't find any information about it.. it would be lovely if you could provide us with some documentations or examples..!

I'm currently using xCode 7.2 with simulator iOS version 9.2. The desired capacities are as following:
caps.setCapability("platformVersion", "9.2");
caps.setCapability("platformName", "ios");
caps.setCapability("deviceName", "iPhone 6");
caps.setCapability("newCommandTimeout", 0);
caps.setCapability("app", prop.getProperty("IOS_APP_PATH"));
caps.setCapability("noReset", false);
caps.setCapability("udid", "358A3CE6-BDD7-4B22-8B5C-4711D6E5D087");
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), caps);
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);

sorry for the long post..! I think it is a sign that i am lost. 👍

Driver does not accept ZIP files in appPath capabilities

This is a feature that is supported in the standard iOS driver, but when I pass a ZIP file, the driver fails:

info HTTP --> POST /wd/hub/session {"desiredCapabilities":{"app":"URL_TO_ZIP_FILE","showIOSLog":true,"sendKeyStrategy":"grouped","newCommandTimeout":10000,"platformVersion":"9.3","bundleId":"","platformName":"iOS","udid":null,"deviceName":"iPhone 6"}}
info MJSONWP Calling WebDriverAgentDriver.createSession() with args: [{"app":"URL_TO_ZIP_FILE","showIOSLog":true,"sendKeyStrategy":"grouped","newCommandTim...
WARN BaseDriver The following capabilities were provided, but are not recognized by appium: app, showIOSLog, sendKeyStrategy, bundleId.
info BaseDriver Session created with session id: f2403b77-33bd-4fc6-b8c3-493ab2a5db86
info WebDriverAgent-driver Determining device to run tests on
info WebDriverAgent-driver udid not provided, using desired caps to create a new sim
info iOSSim Constructing iOS simulator for Xcode version 7.3.1
info WebDriverAgent-driver created simulator 97040B57-359D-49A2-8ACB-45B6A76E08DC. Booting it up
dbug WebDriverAgent-driver Checking whether app is actually present
ERR! WebDriverAgent-driver Error: Could not find app at URL_TO_ZIP_FILE
ERR! WebDriverAgent-driver     at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
ERR! WebDriverAgent-driver     at WebDriverAgentDriver.checkAppPresent$ (lib/driver.js:144:11)
ERR! WebDriverAgent-driver     at tryCatch (/Users/parks169/code/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! WebDriverAgent-driver     at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/parks169/code/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:315:22)
ERR! WebDriverAgent-driver     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/parks169/code/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:100:21)
ERR! WebDriverAgent-driver     at GeneratorFunctionPrototype.invoke (/Users/parks169/code/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:136:37)

Verified the URL for the zip file is valid.

NodeJS 6.1.0
Appium Java client 3.4.1
XCUITest driver @ commit e39444d

Add support to XCUITest driver

@Jonahss @jlipps
One of our developers found a way to search for XCUIElement's using NSPredicate Strings making it a flexible way to find elements similar to what MobileBy.iOSUIAutomation() did.

What would you think if we added something like MobileBy.iOSNSPredicate() to Appium. The pull request to Facebook's WebDriverAgent would be pretty simple, but we wanted to see if it is something you would accept in the Appium repo before we did the work.

Facebook WebDriverAgent pull request: facebookarchive/WebDriverAgent#124

"Info.plist could not be extracted from ipa"

I did the following steps to try out the appium-xcuitest-driver within my installation of Appium 1.5.2 to test against a real device:

  1. Installed Node.js and NPM
  2. Installed 'appium-xcuitest-driver'
  3. Changed the implementation in Appium.app/Contents/Resources/node_modules/appium/build/lib/appium.js to use the WebDriverAgentDriver (which is the one defined in appium-xcuitest-driver 1.0.4) if the platform is "ios".
  4. The current implementation of determineDevice() in driver.js does not yet support real devices (only simulator)... so I changed this implementation to return my real device without a check.

I got an error, that says, that the Info.plist could not be extracted from the ipa. But the same ipa works with the appium-ios-driver.

Add WebDriverAgent touch id support to Appium

I submitted a pull request to facebook/WebDriverAgent that includes support for sending Simulator Touch ID Match and NoMatch commands.

How do we want to include this into Appium? Just include it into core Appium as a route and then into each of the client libs? In theory there might be something comparable in the Android lib at some point, I'd think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.