iOS DOM tree isn't representing the objects on screen - ios

I have an iOS app and i'm trying to run automated tests on it using Appium.
Some of my tests are failing because some objects are missing from the DOM tree. But when I look at the simulator screen, I see that those objects are there.
What can possibly create those differences? I'm not even sure who's fault is this -
Is it bad iOS code in it? Is it Apple's fault? Or is it Appium's fault?
Help would be much appreciated

Taking your feedback into account, there could be several reasons why a element does not show up in Appium but clearly visible on the screen of the device/emulator you use. The ones I know off or read about:
It's a OS problem. Appium depends on the accessibility layer from the OS. Updating or downgrading your OS could solve this problem, but no warranty here.
The app is using custom controls. A custom control will only be accessible if the devs that made the controls implemented accessibility for it.
There is also the possibility that you encountered a bug, known or unknown. Be sure to check the Appium github issues for known bugs, or to get help from the devs tackling a new one.
If trying another version of the OS or implementing accessibility does not solve the problem or is not possible, you will need to tap your element using coordinates. This is a last resort solution if everything else fails.
A very useful article on the problems mentioned above can be found here. It also contains all the resources to address these specific problems, like how to tap by coordinates the right way.

Related

What are Issues with Using Two Crash Reporters in Your App?

I am currently using Crashlytics in my app and it's working well. However, we are thinking of using NewRelic on the backend to better be able to pinpoint issues in our platform. The NewRelic mobile library has a crash reporter built into it as well (that can be opted out of).
I am assuming you don't want to use two crash reporters considering one will trump the other, however, I haven't seen any information on this anywhere and would just like to confirm.
Additionally if you could explain why along with the answer that would be very helpful.
You can only have one signal handler installed. The last one that registers "wins".

Any way to run an iPhone simulator on a web app?

Is there an iPhone simulator plugin anywhere? We want to load some of our apps to our demo website for marketing purposes.
Does anyone know of anything that can do this?
Thanks
It's impossible, unless Apple releases some sort of plugin itself (which I can confidently say, will never ever happen). The closest you can get is to use some mockup templates/scripts to simulate the behavior of your app with Javascript/CSS/HTML5 canvas.
You can look into some web apps which provide similar functionality. Of course, not like the real thing, but at least, they can be a good starting point and even complete solutions for relatively simple projects. I've googled web iphone app mockup and got a few results: https://www.fluidui.com/editor/live/ or http://iphonemockup.lkmc.ch/ may be helpful.

Phonegap iOS app: change keyboard appearance to UIKeyboardAppearanceAlert (again)

A couple of months ago, I posted a question asking if and how phonegap users can alter the keyboard appearance to the dark alert ui keyboard (UIKeyboardAppearanceAlert) without targeting individual textfields. I did some extnsive reaearch myself and offered a bounty but yet the question remained unsolved.
Alter keyboard appearance in native, phonegap/Cordova built iOS App
As of today, I'm still struggling to get this resolved and simply over with. I do realize much probably hasen't happened since last time I bothered you with this question, however, two things have in fact changed which somewhat justifies this seemingly double post:
Phonegap has released version 2.1 which does some new stuff, perhaps this is possible now?
As my client expects me to solve this in any way possible, this time I would also like to ask you for an alternative approach. If it still can't be done, would it be possible to custom make a "keyboard" of my own? I know this of course is technically doable, but is it in any way a recommended approach that would be considered in at least some way smart and justified? As I said, my client pushes hard for this and is not in favor of rebuilding the app completely natively.
Conclusively, as of today is there any way to do this with phonegap / Cordova? If not, would you recommend me to custom make a keyboard using HTML CSS and JavaScript, bearing in mind this is a major comsern for my client? If so, are there any good plugins that I can use as a start? Please check out my old post (linked above) to see what has already been tested.
Thanks in advance,
Jonathan
I know this is quite old but I came accross it looking for the same thing. Anyway, I have found a possible solution which would be to create a plugin for Cordova http://cordova.apache.org/docs/en/2.6.0/guide_plugin-development_index.md.html#Plugin%20Development%20Guide
It does require some native coding but would atleast avoid starting an app from scratch which has already been built in Cordova.

emailing contents of text fields advice needed xcode

when trying to email contents from text fields im having exceptions thrown. I think im wiring them up wrong.
Im creating outlets for my text fields in .h, setting up my email button as an action.
In .m im implementing usual code for sending email. Ui message frame kit has been imported.
Now I need some help as thats not working for me.
To summarise: How do i email whats in my text boxes?
Im using xcode 4.3 with storyboards
Thanks
There are no tricks to emailing the contents of text boxes. You need help with some exception, you need to provide us the precise error and show us the relevant code. If you want to try to solve it on your own, you should debug the code, single stepping through the method that attempts to email the contents of your text boxes (see Xcode 4 User Guide: Debugging and Analyzing Your Code; see the section about adding breakpoints and then the section about controlling execution).
Exceptions are generally the result of memory management problems (e.g. your code is trying to use some object that has already been released) so you might want to enable zombies if you haven't already. I also think that people do not sufficiently appreciate the value of Xcode's Analyze command on the Product menu (described in the aforementioned Analyzing Your Code section). This Analyze command will identify not only dangling pointers, but also some memory leaks. It's not perfect, but it's a good start.
People really shouldn't be posting questions here if they haven't first resolved the problems raised by Analyze (unless, of course, you need help fixing issues that Analyze raises). Personally, when I went through this Analyze exercise on my first big project, it was painful to clean up all the issues that it identified, but, more importantly, I suddenly "got it". I've been an IT professional for decades, have programmed in dozens (literally) of programming languages, but only after going through this painful exercise did I finally get the subtleties of Objective C memory management. Suddenly, rereading Apple's Advanced Memory Management Programming Guide, it all made perfect sense.
So, if you're still stymied, and the Analyze command did not identify any issues, and you ran the code through the debugger you were not able to identify why the exception was generated, then just provide us a detailed error message and show us the relevant code and I'm sure we'd be happy to help.

IPad and Openframeworks

Can someone point me in the right direction to learning how to use Openframeworks to develop and IPad app. Perhaps some good tutorials, I can't seem to find any good documentation.
The docs of openFrameworks is quite outdated. But you can discover OF through the examples. Just download the iPhone package here: http://www.openframeworks.cc/download and follow the instructions in the included readme. I think a good start is, try to get the examples running on your device and start to modify the examples. If you have any further questions, the people here --> http://forum.openframeworks.cc/ will be happy to help you out.
For a more in-depth discover of openFrameworks, look at the inofficial doxygen docs here --> http://ofxfenster.undef.ch/doc/
Getting OF running on iPad is actually pretty much the same thing as running on iphone.
have you got it running before?
if you haven’t, first thing is you need to pay Apple $99 if you want to run it on real device,
otherwise it’s free to try on the simulator.
there is some instructions on OF site for the first run,
just go through it these complicated stuffs only need to be done once:
http://www.openframeworks.cc/setup/iphone/
(the guide is totally not updated at all, but it’s pretty much the same process with minor UI difference)
Any iOS OF example should runs on iPad the same way as iPhone does.
but to get iPad native resolution, you’ll have to change it manually.
it's in Application>General and in Deployment Info change the Devices drop down to iPad. (screenshot attached)
try it with any iOS examples
and if you want to put any code for mac version,
just make a copy of any iOS example and hand paste the code in appropriate void,
they are pretty much the same except mouse event vs touch event.
which a bit different in logic but just play around with it. not too hard to get used to.
basically touch events are touch.x/touch.y instead of mouseX mouseY.
(and touch events are private to each void so you might need other variables to pass it somewhere else)
I don't have a forum link but there was an openframeworks forum question on this just last week and folks posted a number of sites that have good examples/tutorials. Here's one on doing pixel operations for graphic effects:
http://itp.nyu.edu/varwiki/Syllabus/Pixels-S10

Resources