dhemery / victor

A Java driver for iOS applications
MIT License
11 stars 4 forks source link

typeIntoKeyboard method Typed extra character #23

Open victorbeguser opened 11 years ago

victorbeguser commented 11 years ago

Below is my code snippet:

From Snippet 1, it should click on a password field and type "Test$123". But What it does is, it types "Test$1235". Not sure where this 5 got appeneded. Any idea why?

Also please let me know how to provide tab, backspace, enter in victor?

Snippet 1: IosViewIdentifier password= shelley("view:'UITextFieldLabel' marked:'Password'");

    IosView VPwd5 = application().view(password);

    VPwd5.sendMessage("touch");

    Thread.sleep(5000); 

    application().typeIntoKeyboard("Test$123");

Snippet 2:

    IosViewIdentifier setPWD= shelley("view:'UIButtonLabel' marked:'Set Password'");

    IosView SVPwd = application().view(setPWD);

    SVPwd.sendMessage("touch");

    Thread.sleep(5000);
dhemery commented 11 years ago

Is your code set up to log notifications of Frank and HTTP events? If so, I'd want to see the details of what Victor sends to its internal Frank representation, and what that sends via HTTP to the Frank server.

If you need help setting logging for those things, let me know and I'll give instructions. You may be able to decipher these classes (from the Vigor project, which gives a few demonstrations of Victor features):

See Lines 69-72 of https://github.com/dhemery/vigor/blob/master/tests/src/test/java/com/dhemery/victor/examples/runner/OnVigorApp.java That shows how to subscribe to Victor's various "event publishers" through a Channel. Then you give the Channel to Victor, and it will publish events through the channel to your subscriber objects.

When the Vigor project receives notifications, it logs them using logback. You can use another logger, or println(), or whatever. Here are some examples:

I'm most interested to see whether the mystery 5 shows up in one of those events.