iOS app User simulation and monitoring? - ios

I need to develop a new app or code to simulate user interface in another already existing app and get textFields, messages, etc results. Something like KIF (https://github.com/square/KIF), but I would like it to be independently compiled (not embedded in the same project).
Any ideas?

If I understand correctly, you want to have App A to be able to interact with the UI of App B.
This is not possible.

Related

Migrate one of the features in the Android application to iOS

I plan to make an iOS application in the future. How do you create a dialog like the one below on the iOS app? Like Android. Look at the screenshots.
Screenshots
UPDATE: my goal is to make users choose one of their emails to use for a login or register

How does a UI app inspectors (like the one in Appium) work?

Appium has a way to inspect the view hierarchy of an app using an inspector. I am interested in building one myself.
I know the overview answer of: it uses some webdriver to accomplish this. But how?
It puzzles me that a separate iOS app can some how communicate to another app, and show even its screen.
How does it work under the hood? or how does the iOS app communicate to the UI inspector to send its screen shots and hierarchy?
It puzzles me that a separate iOS app can some how communicate to another app, and show even its screen.
Yes! Apps should not be able to do this. But there exists a special kind of app, built just for testing, which IS able to do this.
The way this is done is using Apple's XCUITest framework. When you write an XCUITest in XCode, it builds a special app which is able to start your test app and then communicate with it using the XCUITest methods. These methods allow you to inspect elements in the view.
In order to create a view tree, you start at the root view and iterate over the children, building out a tree with a tree traversal.
Normally, the XCUITest app exits when your test script finishes, which means you won't be able to access it from a desktop app for viewing the tree as it updates. If you write your test script to run an infinite loop and open a network port for communication with an outside process, now you can build your viewer. This is exactly what Appium does, so I suggest you check out the appium source code and maybe just use that?
More information in this blog post
[edit]: Oh yeah, Appium uses Feacebook's WebDriverAgent project as the script that runs on the app. So WebDriverAgent is basically an XCUITest script which runs a server and can take commands during a test. Appium does a ton of work to bundle and package it into the special kind of companion app that is able to access your app, installs it on the iOS device, and then runs the test. WebDriverAgent has a command which iterates over the UIHierarchy and returns the whole tree.

How can I automate WiFi testing using Xcode Instruments?

I want to automate the UI flow on iOS, specifically below steps:
User taps on Settings
Opens WiFi options
Taps on the desired SSID
Enters Username and Password
Taps connect
Opens up a browser
I can do similar flow on Android with Android Debug Bridge. In Xcode Instruments, I don't see any WiFi options listed. Do we have any other tool to automate UI flow on iOS?
The standard is now to use UI Unit tests from XCode. Automation via instruments is deprecated (as far as I know).
However you can automate iOS itself, only the app you are testing. So accessing the settings like this will not work.
I'm also wondering why you need to test this. It's part of iOS and not your app. Therefore it's Apple's job to test it. You can just assume it works.
There is no way to do this on iOS. You may want to look into something like http://www.tapster.io.
Also ui_automation is remove from Xcode 8, so theres that.
I'm having pretty good luck with http://www.tapster.io

Launching a different ios app, within an app

I'm writing a basic application using xcode 5.1. One of the features I'm interested in trying to do is to launch another app or move to other part of iphone, INSIDE the app already running.
Eg. I have an app with 3 menu options, 1 and 2 do certain tasks as part of this parent app, menu option 3 launches another app that's installed on the phone. I'm not sure if this is possible?
No you can not do that. Besides the documented URL handlers, there's no way to communicate with/launch another app.
This is part of the sandbox principle of apple:
https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/TheiOSEnvironment/TheiOSEnvironment.html
What you can do is launch another app by using custom URL-Schemes
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-working-with-url-schemes/

How to automate actions performed on the iPhone simulator?

Right now I am automating tests for an app using UIAutomation class. But my app has certain features which, I believe, can't be tested using just UIAutomation. For example, there is a feature that if a new contact is added to the addressbook, a popup is shown in the app. To test this feature a new contact needs to be added to the address book the popup should be checked. But UIAutomation automates user actions only within the target app. Can anyone tell me how can I automate these type of actions(preferably using scripts)?
i would recommend you automate with Sikuli. its mucvh easier to record and play. also u can any kind of alerts or popups

Resources