--
You received this message because you are subscribed to the Google Groups "Frank" group.
To unsubscribe from this group and stop receiving emails from it, send an email to frank-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Pete,
Yes there are some interesting log messages. I turned on frankLogEnabled in FrankLoader.m to get the attached detailed log. My annotations in the attached log are prefixed “CMT:”. It appears to be some sort of issue with Shelley, in that it can recognize that a view exists (by checking its accessibility label) but cannot touch it for some reason. This works fine when I use the .a files from GIT. It only fails when I build my own.
My own .a files are quite a bit smaller than the ones from GIT. I seem to recall from some help you gave me last year that you don’t build from Xcode, which only produces a .a for a single platform (in this case iPad). You had some command-line “incantation” that I’ve forgotten that you use to build .a files for BOTH iPad and Simulator. Can you please remind me how to do that? It may be that there are other differences in the build you use, other than just multi-platform.
I have no idea what you’re talking about regarding “Web Inspector in your browser”. What is that? What browser do you need? How can it see raw traffic between my PC and my iPad if its running on my Mac?
Thanks,
Martin
The command line “rake” doesn’t work. Here’s what I get:
cmtaylor:Frank cmtaylor$ rake --trace
(in /Users/cmtaylor/_GIT_/Frank_Fork/Frank)
rake aborted!
/Users/cmtaylor/_GIT_/Frank_Fork/Frank/Rakefile:13: odd number list for Hash
puts "building #{{scheme:scheme,sdk:sdk}}"
^
/Users/cmtaylor/_GIT_/Frank_Fork/Frank/Rakefile:13: syntax error, unexpected ':', expecting '}'
puts "building #{{scheme:scheme,sdk:sdk}}"
^
/Users/cmtaylor/_GIT_/Frank_Fork/Frank/Rakefile:13: syntax error, unexpected ':', expecting '='
puts "building #{{scheme:scheme,sdk:sdk}}"
^
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2383:in `load'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2383:in `raw_load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2017:in `load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2016:in `load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2000:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:31
This is with the latest GIT stuff obtained immediately before the “rake” with:
git fetch upstream
git merge upstream/master
Please fix the Rakefile and push it to GitHub so I can get it.
Replacing this line in the Rakefile:
puts "building #{{scheme:scheme,sdk:sdk}}"
With this:
puts "building scheme #{scheme} with sdk #{sdk}"
got rid of the syntax errors. I then got a successful Rake build. I put these artifacts from dist into my app Frank folder and built my Frankified app. When I ran the test like before, this time I got a successful:
POST DATA:
{"query": "view:'UINavigationItemButtonView'", "operation": {"method_name": "touch", "arguments": []}, "selector_engine": "shelley_compat"}
May 7 10:14:12 unknown TI-Nspire SE CAS Frank[4560] <Warning>: Using Shelley 1.1.11.pre1 to select views with selector: view:'UINavigationItemButtonView'
May 7 10:14:12 unknown TI-Nspire SE CAS Frank[4560] <Warning>: tapping at (661.00,240.00)
May 7 10:14:12 unknown TI-Nspire SE CAS Frank[4560] <Warning>: returning:
{"results":[true],"outcome":"SUCCESS"}
May 7 10:14:12 unknown TI-Nspire SE CAS Frank[4560] <Warning>: received request with path (
map
)
Where “touch” on "view:'UINavigationItemButtonView'" generates a “tapping at” log message and a {"results":[true],"outcome":"SUCCESS"}
return value.
Obviously there’s something different about doing a Rake build, vs. a build from inside Xcode! I’ll use the Rake build in future.
Now I’ll go back to trying to integrate and test my fix for the issue I raise so I can submit it back to you with a “pull” request.
Thanks,
Martin
Thanks,
Well, not totally figured out…
Now when I build my own Frank with the Rake command a different Frank feature stops working! We have a custom keypad with buttons for which I have set accessibilityLabel values. One such button is the ENTER key, with accessibilityLabel=”~enter~”. With the GIT-provided Frank.a I can touch it and I see “tapping at…” in the console log. When I do the exact same test with my Rake-built Frank.a I don’t see the “tapping at…” and yet the return value to FrankHelper is the same as if the touch happened OK. I very specifically replaced ONLY Frank.a in my Frankified app, and NOT Shelley.a (which I left as the one provided from GIT).
So there’s still something weird going on in Frank on the iPad when I build it. Do you have ANY idea what could cause such strange behaviours? Maybe I’m still not getting everything I think I’m getting from GIT, but I don’t know what else to try there.
Thanks,
Martin
Slight correction…
When trying to do the touch of ~enter~ I get the “false” for views touched, just like I did before with the navigation button:
POST DATA:
{"query": "view marked:'~enter~'", "operation": {"method_name": "touch", "arguments": []}, "selector_engine": "shelley_compat"}
2013-05-07 11:49:56.228 TI-Nspire SE CAS Frank[4675:707] Using Shelley 1.1.11.pre1 to select views with selector: view marked:'~enter~'
2013-05-07 11:49:56.248 TI-Nspire SE CAS Frank[4675:707] returning:
{"results":[false],"outcome":"SUCCESS"}
2013-05-07 11:49:57.344 TI-Nspire SE CAS Frank[4675:707] received request with path (
"app_exec"
)
I’m adding a test for this and raising an exception in my FrankHelper.py, but I still don’t understand what it means for a query to return “[false]” for its results. Can someone explain the meaning of this, and perhaps how to correct it?
Thanks,
Martin
I’ve finally been able to get Xcode to breakpoint through some of this code in the debugger. What I’ve learnt is that when my custom keypad is displayed and I’m trying to tap on the “view marked:’~enter~’” key, it fails because first the test in this line is False:
https://github.com/TestingWithFrank/Frank/blob/master/src/UIView%2BPublicAutomation.m#L57
and then the test in this line is also False:
https://github.com/TestingWithFrank/Frank/blob/master/src/UIView%2BPublicAutomation.m#L60
The touchedView is this:

But it’s not clear to me what “self” is in this code. Nor is it clear to me why either touchedView must be a descendent of self or self a descendent of touchedView. In general, I think, a keypad is unlikely to be a descendent of any view other than the top-most window. I haven’t yet had time to go through this debugging path for a key on the custom keypad that works (and most of them do), but I’ll try to do that early next week if not today.
In the meantime, Pete and Ondrej, does this give you any further clues as to what’s going on in this non-working GUI object touching?
Hi Ondrej,
In this particular instance of the ~enter~ key, the object with the accessibilityLabel == “~enter~” is a UILabel. Most of the other buttons on the custom keypad are UIButton or custom TINKeyBoardKeyOverlay objects. I’m going to ask our developers a “Why?” question about this when I can catch the right person. In the meantime, I think that if touch events are generated simply at an (x,y) location, then you shouldn’t have ANY logic that would prevent me from touching an arbitrary location. If I touch the wrong location, then nothing, or something unexpected, will happen and that’s an automation bug. I don’t expect the automation tool to prevent me from touching anywhere I want to. If that messes with other users’ expectations, then maybe we need a “forceTouch” method that ignores all this “am I allowed to do it” stuff.
Thanks,
Martin
Hi again,
I did a bit more digging into the .xib file that defines our custom keypad. I found that directly behind the UILabel for which I had set the accessibilityLabel == “~enter~” is a custom TINKeyBoardKeyOverlay object that is the actual button. These two GUI objects have a sibling relationship (i.e. same parent) and not a descendent relationship. By temporarily moving the UILabel object in the .xib file, I was able to access the TINKeyBoardKeyOverlay object behind it. I moved the accessibilityLabel == “~enter~” to that object, then moved the UILabel back directly over it. Rebuilding the app with this change makes it work OK now with Frank as I built it!
So the real explanation for the “Self-built Frank behaving differently from GIT Frank” problem originally raised in this thread is that the set of .a binary files in GitHub do not match the source code. When I build from the latest source code I get your (and others) latest changes which are breaking things in a GUI layout scenario like this.
Regarding the “sibling” style of GUI layout, this layout scenario is fairly typical in our (and I suspect others) apps. Here’s another example that is also broken in the current (my) Frank build:

The UIButton with its child UIButtonLabel are completely invisible, but are behind the UILabel: START GUIDED TOUR and the UIImageView: tutorial_ForwardNeutral1.png (the little arrow in the circle to the right of START GUIDED TOUR words). All 3 of these co-located objects are siblings of a common parent GUI object. I happen to attempt to touch the UIImageView: tutorial_ForwardNeutral1.png because it is uniquely identifiable in a non-language-specific way. This fails with the current build for the same reason that the attempt to touch the ~enter~ label failed.
Could you perhaps add a 3rd OK scenario in your logic that allows you to touch an object if it has a co-located sibling object that will actually respond to the touch event? And by “sibling object” I really mean “any object with a common ancestor” ‘cause there’s no telling if, a GUI designer might make a GUI with such a structure. A simple example of this might be if I tried to touch the unnamed UIButtonLabel in the Symbiote hierarchy above. It has no siblings that could handle the touch, but it does have “Uncles” that would respond.
I think we could implement a specialized method skipping the checks, e.g. "touchScreen". IMHO if you want to touch a view different from the one you are selecting, you should say it explicitly.
I also agree with the need for a “more forgiving” touch method. However I don’t like the proposed name. The “FEX” prefix won’t mean anything to test authors. What about calling it “touchNoChecks”, “looseTouch”, “forcedTouch” or some such name that carries the implication of touching without strict checking? Internally, UIView+PublicAutomation.m will need a whole set of methods that correspond to the current set dealing with touching an object, touching at a point, etc. but without the strict canTouch checks.
In the meantime, now I know the cause of the problems, I’ve re-worked some parts of our product code to name the more correct GUI elements for touching in some circumstances, and I’ve re-worked some of our Python client-side methods to touch different GUI objects that pass the strict checking. This latter part is non-intuitive and I would like to put them back the way they were. One of the techniques our GUI developers used, that breaks the strict touching algorithms, is that when a pop-up menu or dialog is shown the rest of the app screen is “dimmed” by covering it with a semi-transparent “dimming view”. This “dimming view” covers the entire screen and thus prevents touching anything behind it (when strict touch is enforced). However, the user can see through this “dimming view” and, to remove a pop-up selection box for example, would touch again the field in the dialog that they touched to cause the pop-up selection box to appear. When automation tries to touch this same dialog field, now behind the “dimming view”, the strict touch algorithm disallows it. My workaround in these situations was to touch the “dimming view”, which is also valid for a user to do, but not necessarily as common a practice.
I also agree with the more detailed error return suggestions. If such a return was in place this would have saved me about a week of effort to track down the source of these touch failures! Just logging is not enough. These detailed messages MUST come back to the client side (Cucumber or Robot Framework).
Thanks,
Martin
From: frank-...@googlegroups.com [mailto:frank-...@googlegroups.com]
On Behalf Of Ondrej Hanslik
Sent: Friday, May 17, 2013 4:59 AM
To: frank-...@googlegroups.com
Subject: Re: [Frank] Self-built Frank behaving differently from GIT Frank
Hi,
I do agree, quoting myself
I think we could implement a specialized method skipping the checks, e.g. "touchScreen". IMHO if you want to touch a view different from the one you are selecting, you should say it explicitly.
I will push it as soon as possible. I will probably name it "FEX_touchScreen"
I also agree with the logging but I will have to think about it a little. I would like to see the errors in cucumber but I don't want "FEX_canTouch" to log errors when it is used in selectors, e.g. "view FEX_canTouch".
On Friday, May 17, 2013 6:39:51 AM UTC+2, Pete Hodgson wrote:
Martin, Ondrej, much credit to both of you for your dogged diligence in investigating what's going on here.
I guess I'd agree that the situation described isn't a poster-child for good UIKit practices, but at the same time it's not unusual for people to take some shortcuts when needed. It's also not unsual to see non-idiomatic approaches when teams are learning a new framework, and I think Frank shouldn't throw up too many roadblocks - the goal is to help people develop better quality software.
Ondrej, what do you think of Martin's suggestion to add a new method that is less rigorous in the checks it does? Something that checks that the touch is within bounds, but not much else? That'd be similar to how the touch method worked a while ago, I think. Something like FEX_touchWithoutChecks maybe?
I think it would also be really good to have the more rigorous FEX_touch method provide as much debugging information as possible when it decides to not touch a view because the constraints haven't been met. Some options: have FEX_touch return a string describing the outcome: e.g. "view touched", "view not touched because out of viewport", "view not touched because it would not be the recipient of the touch event - consider FEX_touchWithoutChecks instead". Alternatively we could continue to return a simple boolean, but write detailed logs describing the reason a touch didn't occur. Either way I think it's important that these failure messages are verbose, and explicitly point the reader towards the alternate FEX_touchWithoutChecks method.
Very much looking for thoughts and opinions on the above.
On Thu, May 16, 2013 at 12:00 PM, Ondrej Hanslik <ondrej....@gmail.com> wrote:
Personally I think this type of view hierarchy is slightly abusing UIKit :) (why not using tap recognizer or a UIControl with the label and image inside?)
Your proposed change would effectively revert to the version where there were no checks.
I think we could implement a specialized method skipping the checks, e.g. "touchScreen". IMHO if you want to touch a view different from the one you are selecting, you should say it explicitly.
However I would love to hear a 3rd opinion on this.
On Thursday, May 16, 2013 8:41:05 PM UTC+2, Martin Taylor wrote:
Hi again,
I did a bit more digging into the .xib file that defines our custom keypad. I found that directly behind the UILabel for which I had set the accessibilityLabel == “~enter~” is a custom TINKeyBoardKeyOverlay object that is the actual button. These two GUI objects have a sibling relationship (i.e. same parent) and not a descendent relationship. By temporarily moving the UILabel object in the .xib file, I was able to access the TINKeyBoardKeyOverlay object behind it. I moved the accessibilityLabel == “~enter~” to that object, then moved the UILabel back directly over it. Rebuilding the app with this change makes it work OK now with Frank as I built it!
So the real explanation for the “Self-built Frank behaving differently from GIT Frank” problem originally raised in this thread is that the set of .a binary files in GitHub do not match the source code. When I build from the latest source code I get your (and others) latest changes which are breaking things in a GUI layout scenario like this.
Regarding the “sibling” style of GUI layout, this layout scenario is fairly typical in our (and I suspect others) apps. Here’s another example that is also broken in the current (my) Frank build:
The UIButton with its child UIButtonLabel are completely invisible, but are behind the UILabel: START GUIDED TOUR and the UIImageView: tutorial_ForwardNeutral1.png (the little arrow in the circle to the right of START GUIDED TOUR words). All 3 of these co-located objects are siblings of a common parent GUI object. I happen to attempt to touch the UIImageView: tutorial_ForwardNeutral1.png because it is uniquely identifiable in a non-language-specific way. This fails with the current build for the same reason that the attempt to touch the ~enter~ label failed.
But it’s not clear to me what “self” is in this code. Nor is it clear to me why either touchedView must be a descendent of self or self a descendent of touchedView. In general, I think, a keypad is unlikely to be a descendent of any view other than the top-most window. I haven’t yet had time to go through this debugging path for a key on the custom keypad that works (and most of them do), but I’ll try to do that early next week if not today.
to treat the attempt to touch an 'untouchable' view as an automation error... might be the clearest approach
The reason for the FEX_ prefix is to prevent naming collisions. This is an unfortunate but real problem, so we have to do it despite the clunkiness. It can be hidden away on the client side inside the automation driver.I agree that a method name that implies it's a 'looser' or less strict way of touching a view would be good. touchScreen doesn't convey that to me.Another idea for getting the error string back to the client would be to treat the attempt to touch an 'untouchable' view as an automation error, and use the existing error reporting mechanism to get the message back to the client. I think that might be the clearest approach.
Cheers,Pete--Typed on a little bitty keyboard
I also agree with the need for a “more forgiving” touch method. However I don’t like the proposed name. The “FEX” prefix won’t mean anything to test authors. What about calling it “touchNoChecks”, “looseTouch”, “forcedTouch” or some such name that carries the implication of touching without strict checking? Internally, UIView+PublicAutomation.m will need a whole set of methods that correspond to the current set dealing with touching an object, touching at a point, etc. but without the strict canTouch checks.
In the meantime, now I know the cause of the problems, I’ve re-worked some parts of our product code to name the more correct GUI elements for touching in some circumstances, and I’ve re-worked some of our Python client-side methods to touch different GUI objects that pass the strict checking. This latter part is non-intuitive and I would like to put them back the way they were. One of the techniques our GUI developers used, that breaks the strict touching algorithms, is that when a pop-up menu or dialog is shown the rest of the app screen is “dimmed” by covering it with a semi-transparent “dimming view”. This “dimming view” covers the entire screen and thus prevents touching anything behind it (when strict touch is enforced). However, the user can see through this “dimming view” and, to remove a pop-up selection box for example, would touch again the field in the dialog that they touched to cause the pop-up selection box to appear. When automation tries to touch this same dialog field, now behind the “dimming view”, the strict touch algorithm disallows it. My workaround in these situations was to touch the “dimming view”, which is also valid for a user to do, but not necessarily as common a practice.
I also agree with the more detailed error return suggestions. If such a return was in place this would have saved me about a week of effort to track down the source of these touch failures! Just logging is not enough. These detailed messages MUST come back to the client side (Cucumber or Robot Framework).
Thanks,
Martin
From: frank-...@googlegroups.com [mailto:fra...@googlegroups.com] On Behalf Of Ondrej Hanslik
Thanks very much for this. It works fine and I’ve integrated use of it into my Python FrankLibrary so that “Force” is an option on the Tap method, defaulted to True for my purposes.
I’ve now integrated my own enhancements for Issue #203 and am in the process of testing them and getting permission to release them with a Pull Request.
Cheers,
Martin