English 中文(简体)
目标:目标:主机没有找到关键N。
原标题:target.frontMostApp().keyboard() failed to locate key N

I m试图将钥匙板打成自动识别器。

target.frontMostApp().keyboard().typeString("INTERCOM")

但是,在先对我进行分类后,我会发现这一错误。

target.frontMostApp().keyboard() failed to locate key  N 
Script threw an uncaught JavaScript error: target.frontMostApp().keyboard() failed to locate key  N 

我有一个地方化的重要板。

任何人都知道这一ug或我所想的东西是否错过?

问题回答

这可能有助于:

var vKeyboard = target.frontMostApp().keyboard();
vKeyboard.setInterKeyDelay(0.1);
vKeyboard.typeString("INTERCOM");

By default this delay is set with 0.03 seconds. This is not enough for your application to update the keys on your keyboard. Increasing this timeout between determining keys for typeString keyboard method will help you. There is no description for setInterKeyDelay on UIAKeyboard reference page but this method is available for UIAKeyboard. Also I m not sure about other languages. I do not know if typeString allows to type on other languages but this 100% works for English keyboard for iOS 5.x.

try{
    target.delay(1);
    target.frontMostApp().mainWindow().textFields()[0].tap();
    target.delay(1);
    target.frontMostApp().mainWindow().textFields()[0].setValue("INTERCOM");
}
catch(err){
    target.delay(1);
    target.frontMostApp().mainWindow().scrollViews()[0].textFields()[0].tap();
    target.delay(1);
    target.frontMostApp().mainWindow().scrollViews()[0].textFields()[0].setValue("INTERCOM");
}

我也这样说了,我认为,这是一个描述太快的事例。

看来,关键名称的变动取决于变化的纽扣状态。 如果能够转换,则钥匙称为N ,如果不能够转换,那么该钥匙就算无。 正在对你发出指示,即轮船停泊在顶楼前。 你的测试试图在Shift hton受到压力之前宣传N钥匙。 它对你的第一封判刑信没有影响,因为第一封来信的主机已经转变。

这还影响在高等级后对下级性质进行分类:下级性质可能会被归类,而下级则处于不抑制阶段。

我用不同类型编码方法对每一方字母进行打字。

for (i = 0; i < title.length; i++)
{
    var strChar = title.charAt(i);
    target.frontMostApp().keyboard().typeString(strChar);
}

与此相对照的是,要整整条铺设,要花很多时间。

You may also want to look at the following link which provides a similar solution but uses the app.keyboard().keys().tap() method for each character of the string instead of the typeString() method. http://jojitsoriano.wordpress.com/2011/06/27/ios-ui-automation-typing-a-string-in-a-uiatextfield/





相关问题
UIAutomation iPhone App Read from a file

This is regarding iPhone App UIAutomation. I was able to automate the App flow, now I wanted to read a file to us the file data i.e. text file / csv file. Can you please let me know how we can read ...

Invoke iPhone app automatically

Is it possible to invoke iPhone Simulator and launch app through UIAutomation? If so, is it possible to invoke UIAutomation script through shell script or Java? Or can I able to do this through ...

iPhone UIAutomation button tap does not fire

I am trying to use UIAutomation in Instruments with the iPhone Simulator and the latest iOS SDK 4.1. Here is the snippet of javascript that is having a problem: // there are sufficient delays here ...

Handling Alert with UIAutomation

I m trying to test the presence of an UIAlertView with UIAutomation but my handler never gets called. At the beginning of my javascript i write : UIATarget.onAlert = function onAlert(alert) { ...

使用UIAutom的文书中未预见到的错误

我目前正在使用SDK 4.0.2,并学习如何做UIAutomation。 不幸的是,我发现,在Simulator,当我尝试进行简单的 Java印测试(这只是转让变量)时,我会收到......

Does UIAutomation framework works on the simulator?

I am new to iPhone Automation, and UIAutomation framework introduced by iOS4. Recently I am using UIAutomation to automate testing app on iPhone Simulator via instruments but it gives me an error like ...

热门标签