0
私はiPhone用のUITestingを試しています。最初のテストを実行するには、スタンフォードのcs193p iTunes Uクラスの講義2の単純なrpn電卓を使用すると思いました。スクリプトが罪を実行しかしiphone UITestingボタン番号
var target = UIATarget.localTarget();
target.frontMostApp().mainWindow().buttons()["3"].tap();
target.frontMostApp().mainWindow().buttons()["Enter"].tap();
target.frontMostApp().mainWindow().buttons()["4"].tap();
target.frontMostApp().mainWindow().buttons()["/"].tap();
var display = target.frontMostApp().mainWindow().staticTexts()[1].value();
if (display == "0.75") {
UIALogger.logPass("3 E 4 /");
} else {
UIALogger.logFail("3 E 4 /");
}
次のように
私のjavascriptのは、ある編集者のCoS/ が、それはそう何とか楽器を
target.frontMostApp().mainWindow().buttons()[3].tap();
target.frontMostApp().mainWindow().buttons()["Enter"].tap();
target.frontMostApp().mainWindow().buttons()[4].tap();
target.frontMostApp().mainWindow().buttons()["/"].tap();
を示しているログに私の文字列「3」に変換されて入力してください3番目のボタンをタップします。
私はインデックス番号でボタンを呼び出すことができましたが、テキストで呼び出すことを好むでしょう。