I am trying to automate iPHone UI testing throught JavaScript.
I am in a compose mail page and I need to enter email-id in the TO,CC & BCC fields. I have the focus in TO field and keyboard is displayed. To field is UIATextField, however the usual way of entering data into textfield is not entering the data.
I used the following code
var app = UIATarget.localTarget().frontMostApp();
app.keyboard().elements()["go"].tap();
But did no good for me 🙁
I want to input the email address(abc@xyz.com) through the displayed keyboard.
Please help me with a code snippet. Also please let me know how to change the focus from “TO” field to “CC” which are one below the other.
The Header, Body buttons on the page are a segmentedControls. I am not able to tap them using the code snippet.
var app = UIATarget.localTarget().frontMostApp();
app.segmentedControls()[0].buttons()["Body"].tap();
Please help me with this.
Thanks in Advance
Kiran
I think you could do this a little better and with some reusability. Try defining a method like this:
A quick test of this might look like this:
Then you sit back and enjoy watching the keyboard type out a nice date for you.