iOS UIAutomation - reading the title of the navigationBar - uinavigationbar

How do I check against the value of the title of the navigationBar in my app, using UIAutomation javascript? I've tried all sorts of things, like
target.frontMostApp().navigationBar().title
target.frontMostApp().navigationBar().name
target.frontMostApp().navigationBar().value
And a few others, and none of them work.

Turns out, it works with this:
target.frontMostApp().navigationBar().name()

You can access it by using the following script:
target.frontMostApp().mainWindow().navigationBar().staticTexts()[0].value()

Related

Adding array of UIImage in a UIViewController with some alignment

I just started my first project in iOS, recently I have encountered a problem in the UI when i receive it from the designer.
The expected output is shown as below and i can do most of it without any problem.
Now the problem came when I am about to implement this :
As the number of colour varies depending on item, I cannot add it like what I did for the share and love button I have no idea how can i implement something like this, I have look through the Object Library in the storyboard and cannot find any that can produce the output as expected .Any helps and guides are much apprecited!

iOS error message tooltip

I need to show error message as a tooltip in iOS 8 but i don't know how to do it. What I want is something similar to the one shown in below image (I'm referring to the tooltip with messages Select and Select All):
There is a great collection of libraries which already target your problem.
For example have a look at: AMPopTip.
Then you could show the popover like:
self.popTip = [AMPopTip popTip];
[self.popTip showText:errorMessage direction:AMPopTipDirectionUp maxWidth:200 inView:self.view fromFrame:textField.frame];
and hide it:
[self.popTip hide];
Have a look at the github repo there are more examples for customizing this control.
You can find more which might suit your needs better here: cocoacontrols.com
I had a similar problem and wrote my own custom tooltip.
You can init with your custom view (i assume you write some delegations to detect actions within.) and present from anywhere.
Maybe not the best replacement of UIPopoverController but still works great. And a lifesaver for iPhone. Also highly customisable.
https://github.com/akeara/AKETooltip
Hope this helps.

UITextField visibility false in appium test iOS

I have devoleped a simple iOS app and on test using Appium all the UIControls staus is shown as visibility false. The below image is the screenshot of the test. I set accessibility label on storyboard
The code I wrote for a simple textfield is given below.
self.txt_txt.isAccessibilityElement = YES;
self.txt_txt.accessibilityElementsHidden=NO;
I have done a little R&D on this and haven't found anything keep 'visibility ' true for UIControls.How to keep visibility true in the above case.If not in code are there any other scripts to run?. Any thoughts are welcome.
I believe this is a bug when using iOS8, based on the information shown in the Appium bug database here:
https://github.com/appium/appium/issues/4131
Looking at the last comment to this bug, it seems that in iOS7 elements are correctly identified as "visible: true", but the same ones in iOS8 are not.
As far as I understand it, at the moment it's not yet clear if this is a bug in Appium or in iOS8.

UIButton appears different on runtime

I just added a button to the storyboard, but when I run the simulator it appears like in the following picture:
Can someone explain me why this is happening ? For the record I am using Google+ Platform for IOS sdk.
Is kinda weird. Did you set it up programmatically on your view controller class? if not, try adding it programmatically.
The problem is that if you include GooglePlus.bundle in your project, the button will appear like that. It includes the GPPSignIn button.

Is there a way to programmatically configure the notification display setting for an ios app?

I tested it on two iphones : on the first the setting was set to 'none' and on the second it was set to 'banner' (seems weird). I would like to know if there's a way to explicitly code that in the app? Thanks :)
Now I know there's no way to do that.

Resources