Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting the frame #7

Open
smaljaar opened this issue Jun 14, 2014 · 1 comment
Open

setting the frame #7

smaljaar opened this issue Jun 14, 2014 · 1 comment

Comments

@smaljaar
Copy link

Hey, I was using the ui-auto-monkey framework and i really wanted to use it in a specific frame. I ran across an issue there, but maybe i'm just using the code wrong.

So I set a frame with x = 0 and y = 70 so the monkey would not tap on a navigation bar. However when I released the monkey on iPad and also allowed for the event to change the orientation, I got taps out of bounds.

I think the problem comes from that I don't know what I should set the frame width and height to, if I need to set them at all.

Any ideas?

@jonathanpenn
Copy link
Owner

Ah, you know what, I don't think the frame limiting code takes rotation into account. I don't use the frame limitations myself. It was added by Olivier Halligon. He must not have needed to worry about different orientations with his frame limiting, either.

If you want to change it, all the logic for choosing random x and y locations on the screen are in these two methods:

https://github.com/jonathanpenn/ui-auto-monkey/blob/master/UIAutoMonkey.js#L230

and

https://github.com/jonathanpenn/ui-auto-monkey/blob/master/UIAutoMonkey.js#L246

You can tweak these two methods to take the orientation into account. When you think you've got it working, submit a pull request and I'll get it merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants