Comments (7)
Hmm. I'm not able to reproduce this. The script runs fine against all the apps I have, even in the Retina 4-inch simulator.
If you create a blank project from one of the iOS Xcode templates, does the same error occur for you? What version of Xcode are you running?
from ui-auto-monkey.
I'm running 4.5 Xcode version.
With a blank project everything runs perfect and I tried to simulate situation with custom alert dialog which show some results.
Here's code https://gist.github.com/3968790 . I'm using a "Single view" project template here.
from ui-auto-monkey.
Okay, I tried a version of what you sent me and I still can't reproduce the problem. Since I didn't have access to your MPViewController
and it's xib file, I just used a plain old UIViewController
in my fork of your gist:
https://gist.github.com/3969536
I'm wondering if there's something in your MPViewController
that's triggering this problem. Can you try changing your app delegate to use just a plain old view controller like my gist and try again? I want to first figure out if it's your machine or your custom view controller. If the problem goes away using a generic view controller, then that might help us isolate what's happening a little better.
from ui-auto-monkey.
My bad, I forgot to remove project prefix. MPViewController
is standart uiviewcontroller that comes with "Single view" project template.
It's a little bit hard to reproduce issue anyway, you need to run script couple of times. But in my case exception appears basically in every script iteration (in best case script manage to pass ~600 events)
May be it's possible to surround tap call with some try/catche block?
from ui-auto-monkey.
Ah, I see. I'm able to reproduce it now. Not very frequently, though.
So, I'm not really sure, but on a whim I padded the x and y random coordinate generation with one pixel and it seemed to fix it. Running several times got all the way through to 1000 events.
Can you pull down the latest, or make the changes in this commit and then see if that solves it for you?
from ui-auto-monkey.
Indeed, tapWithOptions
failed with bound coordinate like 320 for X. We can extend logging and wait for result or just directly invoke tap tapWithOptions
with invalid params.
tapEvent: function() {
var tapPoint = { x: this.randomX(), y: this.randomY() };
try {
this.target().tapWithOptions(
tapPoint,
{
tapCount: this.randomTapCount(),
touchCount: this.randomTouchCount(),
duration: this.randomTapDuration()
}
);
}
catch (error) {
UIALogger.logError(error + " " + tapPoint.x + " " + tapPoint.y);
}
}
We can remove + 1
here, cause automator accept (0,0) tap point:
return Math.floor(Math.random() * 10000) % range + 1;
Or add - 1
like you did:
this.target().rect().size.height - 1;
& this.target().rect().size.width - 1
So, issue is solved.
And You rock! :) Thanks for maintenance
from ui-auto-monkey.
You're welcome! Thanks for helping me fix this. :)
from ui-auto-monkey.
Related Issues (20)
- Xcode 6 compatibility? HOT 7
- Function: lockForDuration() is failed to unlock the simulator HOT 3
- How to write a scroll UIScrollView test? HOT 4
- Avoid modifying ui-auto-monkey HOT 1
- ui-auto-monkey script would stop when app go to background HOT 4
- Monkey script auto stops without doing anything (On iOS 8.1 simulator, Xcode 6.1) HOT 2
- More elements on MainWindow, dump elements too slow. HOT 1
- UIAElementNil is not a function (evaluating 'aButton.isNotNil()') on line 53 of buttonHandler.js HOT 3
- Handlers would only be activated after one minutes run. HOT 2
- How to execute this script from console HOT 2
- UIAutoMonkey.RELEASE_THE_MONKEY() is undefined HOT 8
- Can I use this kind of testing with CI systems? HOT 2
- the random algorithm has an error
- Xcode 8 compatibility? Instruments' Automation support has been replaced by Xcode's UI Testing infrastructure. HOT 1
- Xcode 8 ? HOT 4
- Forgot to update pod spec
- clickVolumeDown() is incorrect HOT 1
- setting the frame HOT 1
- iOS simulator crash HOT 1
- OSX Support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui-auto-monkey.