Instruments UI Automation tests for iPhone app - iphone

I'm a newbie in UI Automation using instruments and I have the following question:
- the application starts and I get the mainWindow screen (which contains SignIn and Register buttons)
- I've managed to write the JavaScript code in order to tap one of the two buttons.
-> after tapping one of the buttons, another screen is displayed. let's say the Sign In screen which contains two fields: username and password.
In this case, how can I tell Instruments that this is another screen and this contains another elements that should be retrieved in order to fill the fields and tap the Sign In button ?
I only know to retrieve the mainWindow. I don't know how to write the code for a next screen

Did you try to capture what you do with the small record button in the Javascript editor window? That way you can find out how Instruments can call the elements you use.
See also this thread:
UI Automation - how to capture - record using javascript editor

Related

How does one access the current SceneDelegate from a XCUIApplication object?

I went through the official documentation and the autocomplete options in Xcode but couldn't find anything.
UI Tests are not supposed to provide you application code access. You test them as a user would (black box testing).
On current screen,
find a button with label "Get Started"
Tap on it
Swipe Up etc.
You would exercise the app as a user would use it, tap on A, wait for B to appear on screen etc.

Accessing elements of webview within a native iPhone app using UI Automation

I am working on UI test automation using Apple's UIAutomation framework for a native iPhone app that uses web views for its checkout transactions. The problem I am facing is that when I tap on Checkout button from the native app, a webview within the app opens up which has a button named 'Complete Checkout' that I am not able to access. I have tried using target.logElemenTree() to get the elements of the WebView, but I do not get to see anything in Instruments. Can anybody let me know how to access webview elements within the native app on iOS?
You can get the X,Y coordinates of the Complete Checkout button and have UI Automation tap it. For example, if the X,Y coordinates of the button are x:10, y:20 you would run target.tap({x:10, y:20});
If your checkout button is a link inside a webview then you will be able to access it.
check the property of the "complete checkout". Tapping using X and Y co-ordinates is not a recommended option.

Positioning ListViews in WinJS Metro apps using scrollIntoView

I am building a jscript-based Windows 8 Metro app. The main screen of this application is a scrolling "panorama" view with several list views showing various aspects of the app's state. In some cases the user will select something on the page which results in a navigation to another page (using the WinJS.Navigation.navigate method.
When the user hits the back arrow on the other page, it returns to the main screen, and I use "scrollIntoView" on to position the screen to the section that the user was working on before the navigation occurred.
Unfortunately this hardly ever results in correctly positioning the view. It seems random. I suspect that the page isn't finished being built yet and that the scroll values are set based on the state at some snapshot in time.
Now the question:
Is there some what to be notified by WinJS ListView objects that they are completely rendered and layed out? Or is this the job of the page's ready function?
Thanks for any insight!
Putting multiple list views side by side is Not A Good Idea(TM). I would recommend putting one list view, and placing your content in a grouped data source to get the groups. If the items have different templates, then you can use a custom item Template selector to dynamically select a template.
Additionally, to ensure that the list view is scrolled to the right position, you need to use the indexOfFirstVisible to set the items the name suggests.

How do I get a pop-up to display on my iphone application?

I would like to know how to display a pop-up with some text, in an iphone application that I am developing. The part of the app I am talking about consists of some text pulled in from a plist file, all this happens in a view controller object which also consists of a button. When the user presses the button, I would like to show a pop-up window (not a small alert like the one obtained using UIAlertView but one similar to the pop-up ads that appear when you launch certain apps on the iphone, with the background dim and a window with a close button etc etc..), ya so anyway I would like to know how to achieve this, mainly if there is any pre-defined class that can make this happen. Any help would be highly appreciated. Thanks in advance.
You could use MBProgressHUD for this. You can add custom views in it and it also has the dimBackground property to dim the containing view and many other useful things.

iPhone: A built in way to show the user a simple warning/alert message

I have a custom built sign up component that I would like to enhance. I would like to show error messages before sending the data to the server (like "invalid email") using a built in alert system (other than modal) if possible. Is there any on iOS? Do I have to build one myself? I saw that some apps show a grey rectangle near the bottom of the screen, is that custom built?
Thanks!
Check out this code sample if you want to use Tweetbot style notifications in your application, these are non modal
http://blog.mugunthkumar.com/coding/ios-code-tweetbot-like-alertpanels/
All iOS alerts are modal (for now). You will have to build your own if you want different functionality, but it isn't too difficult. You can put together a little UIView with a label that is normally hidden. Then just set the text and show it when you need to.