how can i use type() in the phone simulator

Asked by sangzh

The application i will test is the phone simulator, i want to input something in the message editor, but when i use the type("abc"),the "abc" can not be inputed in the editor.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
j (j-the-k) said :
#1

I don't know what program "phone simulator" is, but type("abc") works just as if you would type abc with your keyboard (keep in mind only english keyboard layout works at the moment), so I don't think this is a sikuli problem, maybe the software you want to test does not have focus or your sikuliscript has some mistakes.
Anyway, without more information the reason for your problem is hard to guess. I suggest you post your sikuliscript here.

Revision history for this message
sangzh (sangzhenhua) said :
#2

Thanks you for your quickly response very much, I post the sikuliscript below

app = App("E:\sang\work_tiger\MoDIS\MoDIS\modis\modis\MoDIS.exe")
app.open()
wait(10)
click("1336121639718.png")
wait(1)
click("1336143003656.png")
wait(0.5)
click("Writemessage.png")
wait(1)
click("Tsxi.png")
wait(1)
app.focus()
type("abc")

Revision history for this message
sangzh (sangzhenhua) said :
#3

In addition,I want to explain the "phone simulator", when the program "phone simulator" is running, you will see a mock cell phone with the same outlook as the real cell phone,you can use the mouse to touch the keyboard like using fingers to touch the real phone.

Revision history for this message
RaiMan (raimund-hocke) said :
#4

might be, that the additional app.focus() disturbs your workflow.

supposing that the click("Tsxi.png") gives focus to the text input field, the type("abc") should do what you want.

BTW: on some GUI's, it is possible to use type(Key.TAB) to give focus to the next GUI element.

Revision history for this message
sangzh (sangzhenhua) said :
#5

But if I do't use app.focus()the type('abc') is executed in windows input editor not in the tested application.
In addition, after click("Tsxi.png"), the editor box already gets the focus,so don't need to use type(Key.TAB)

Revision history for this message
RaiMan (raimund-hocke) said :
#6

Sorry, did not want to irritate you with my BTW. This was only an option, if applicable for your situation: tabbing through the GUI elements.

So let me try again:
If that the click("Tsxi.png") gives focus to the text input field of the tested application (positions the caret (text input cursor)), then a following type("abc") should do what you want.

so clearly said: before using a type("some-text"), the GUI element (text input field(area) must be ready to accept keyboard input.

You might test this, if you run your script without the type() and then check your applications GUI manually.

Revision history for this message
sangzh (sangzhenhua) said :
#7

Thanks for your response!
If I don't use type(), I can use mouse to touch the keybroad of the phone simulator to input some text.
The keybroad is not of the computer but the phone simulator. Can sikuli type directly from the phone simulator?

Revision history for this message
sangzh (sangzhenhua) said :
#8

If needed, could you offer me your email, then I can pass a phone simulator to you?

Revision history for this message
RaiMan (raimund-hocke) said :
#9

feel free to send me whatever you like (best including your zipped Sikuli stuff):
https://launchpad.net/~raimund-hocke

Can you help with this problem?

Provide an answer of your own, or ask sangzh for more information if necessary.

To post a message you must log in.