Hi we change the title of the nav bar to a button so we can show the user a new set of information when tapped. This however makes life difficult for UI testing with XCUITest. We change the title to a button programmatically and I have set the accessbilitylabel and still can't access the button.
I have changed the accessibility label.
Search by text (even though it is dynamic pending user selection)
Used the UI Accessibility inspector- the one with the iOS 9 < sims and the new one with Xcode 8.
Search by otherElements
I did the record and tapped the button but it gave me nonsense and when i used nonsense it hits another spot of the view
Any help would be appreciated.
Related
Yesterday I asked the same question but I forgot to say that it was for Xamarin.Android, not for Android(JAVA) (sorry about that) and the solution I got was for Android(JAVA) but I can't implement it on Xamarin.Android. I didn't delete the question, I left it just in case someone in the future needs it for Android, but I want to know the solution for Xamarin.Android.
I have the following MainActivity:
When I click on "Congreso" button the following activity appears:
And when I click on "Programa" button the following activity appears:
All activities except MainActivity have an action bar with a back button, a title of the activity aligned at the same place each time and the same color of the action bar. In my case I want the color to be blue. My question is, is there a way to set that behaviour on a single place in the application and it to apply to all the activities except for the MainActivity so that if some day I want to change the color of the action bar or the alignement of its title I don't have to go to all activities one by one and change it.
P.S.: I don't know if what is on the screenshots is an action bar or it is a toolbar. If you give me a solution with a toolbar it is OK too.
Is there some way to detect when the user changes assistant menu or how it is called?
I'm successfully updating the view position when keyboard show/hide or change the keyboard type emoji and etc. But I'm unable to find how to get notification when users hides or extends word suggestion area.
Image showing the action that I'm trying to catch http://i.stack.imgur.com/hY3di.png
What about UIKeyboardWillChangeFrameNotification?
I'm working on an App with Objective-C but I have a problem with my form.
I have several inputs view (UITextField) on it, and one with a particularly behavior.
When I select the checkbox, I prevent the user typing on the view and looks the view as disable( grayed out and without the blue bar flashing blue bar ) and keep the keyboard open.
When I set the UITextField as disable, the keyboard is automatically hidden.
Someone knows how to keep the keyboard open?
I need to something like the image attached, but without the blue bar flashing blue bar.
I did the logic to prevent the the user enter data on the input , but the keyboard is automatically hidden.
If the text field is disabled, the user cannot type into it and the dismissal of the keyboard is correct. You should not try to fight against that. (It sounds like you're trying to disable the keyboard for the wrong reasons anyway.)
In this case, it sounds like your timing is just off. When the user clicks the checkbox, your code responds. What you are doing there is just wrong. You should respond by moving the first responder to the next enabled text field yourself, and then disabling the first text field. That way, you are not disabling the text field while it is first responder; that's your whole mistake right there.
I have a navigation controller stack where one of the views has a dynamic title.
The view controllers and their titles go like this:
Main --> ItemsTableView --> ItemDetails
Title:Main Title: NN Items Title: Details
Because the iOS UINavigationController sets the text of the "Back" button to be the title of the previous screen, the "Back" button on the details screen says "< NN Items" where NN is a dynamically changing number.
I'm trying to do some iOS UI automation, but the accessibility Label / ID of the back button is set by the system to it's button text. This means that the accessibility label of the back button on the details screen will change dynamically, and I can't find it from my scripts!
If I could get a reference to the UIBarButtonItem then I could easily set it's accessibilityLabel or accessibilityIdentifier from code to be a fixed string, however I can't figure out how to do this?
All of the stuff I've been able to find references setting the back button to a custom button via self.navigationItem.backBarButtonItem or similar, but when I read this property it's nil. I haven't been able to find out how to get access to the standard item without replacing it. I'd prefer not to replace the button if possible
This was bugging me as well. I've been writing Xcode 7 UI Tests and was trying to come up with a generic way of tapping on the back button without having to replace it with a custom button.
The following is how I solved this for Xcode 7 UI Tests - but you may also be able to apply this to UI Automation as well.
I discovered that (in terms of Xcode 7 UI Tests at least) the back bar button item that is created by the system consists of two buttons the entire thing is a button with an accessibility label of whatever the title of the button is, and then the arrow is also a button with an accessibility label of "Back".
Thus, as long as there aren't any other buttons on the screen that are identified as "Back", the back button can be accessed via the accessibility label of "Back". Like so in the case of UI Tests:
[[app.buttons matchingIdentifier:#"Back"] elementBoundByIndex:0]
Here I'm getting the first button that can be identified by "Back". I my case there could only ever be two such buttons - the arrow, or the whole back button itself (in the case where the back button's title is also "Back"). Since both of these buttons are essentially the same, just getting the first one it finds is sufficient.
As a new MonoToucher, I have a question which I'm struggling for a while now:
In some cases in my app I need to display a UITextView with a button to its right, at the bottom of the screen.
Basically, I would like to manage some kind of discussion feed in which when the user navigate to a specific discussion he gets the related posts as a list and have a multi-line text input at the bottom of the list with a 'Post' button to the right.
Touching that textView should show the keyboard for input, and the height of the textView should be related to the data entered.
This is the same behavior as we have when we want to write a new Text Message in iPhone, or a post in Facebook.
Another requirement is, that when the user scrolls the posts list, that input (with the button) should not move.
I tried creating a UIToolBar with UITextView and a UIButton, but I can't make it work as expected.
Check out the BubbleCell sample, it does exactly what you want in C#:
https://github.com/xamarin/monotouch-samples/tree/master/BubbleCell