I did read those three posts:
UIAutomation : Cancel button on Alert view is tapped without actually doing it
UIATarget.onAlert = function onAlert(alert) Issue - Script doesn't seem to go into block correctly
and I know this issue can be fixed. I tried to use the methods which people came up with in the posts but it doesnt really work for me. I would like to ask here again...
So I need to type a password on the alert window. Like this:
target.frontMostApp().keyboard().typeString("1234");
I was wondering if I should write the onAlert function first, and put this line of code after the onAlert function? Or write the onAlert function first, and then put this line of code inside the onAlert function?
I tried to do something like this:
UIATarget.onAlert = function onAlert(alert)
{
return true;
target.frontMostApp().keyboard().typeString("1234");
}
But it is not working... The cancel button is still being tapped... Thanks!