Second word always disappears when using typeText in Xcode UITest - uitextview

I have a UITest, and I'm trying to confirm the text is being saved correctly, entering it like so:
let wonderfulTextView = elementsQuery.textViews["Wonderful"]
wonderfulTextView.tap()
wonderfulTextView.typeText("Think of all the beauty left around you and be happy")
But it's always missing the second word, regardless of what text I put in. The above would end up "Think all the beauty..."

This was fixed by making sure that the hardware keyboard was disconnected in the simulator.

Related

What is the purpose setFocusable(true) in android studio?

I'm new to android studio. I was a bit confused with the following code.
EditText emailEt;
if(!Patterns.EMAIL_ADDRESS.matcher(email).matches()){
emailEt.setError("Invalid email address");
emailEt.setFocusable(true);
}
What is the purpose of this setFocusable() method?
what will happen if the boolean value passed was set to false?
If you're not sure of what focusable is, here's a brief explanation.
If there's a form in a view, there can be 2 cases -
The keyboard comes up automatically, or when you hit the next/enter key on the keyboard the next input field is selected automatically for receiving the input
You need to manually press an input field to bring the keyboard for typing. And on hitting enter, the keyboard might just go away.
The above phenomenon is called Focusing.
Getting back to question, if you want the case (1) to occur, then you set setFocusable() to true, else if you want case (2) to occur, you can set it to false.
Reference the below docs for more info
setFocusable - View | Android Developers
android:focusable - View | Android Developers
difference between focusable and clickable - StackOverflow
I don't think it is much useful but it helps in request focus to next edit text when the next button is pressed android keyboard

" button instead of < in my external keyboard

Recent weeks I was using my keyboard with Turkish language.
I would like to write " when I clicked the top left button, under the escape key. I don't want to write < character.
How to solve it?
You would have to have a way of changing the keyboard bindings. This might be possible depending ont he manufacturer.
Other options would be to create a short cut for the symbol you want. There are three double quoates I know of and if this is for coding you will want to make sure to pick the right one. But say you want the straight double quotes, then you can create a short cut that writes out the symbol.
Alternatively you can you can use the Alt codes tp produce it. Like Alt 0148 for "
I have solved the problem. I changed my keyboard type without knowing it. So corrected it on System Preferences -> Keyboard -> Change Keyboard Type.

Using ncurses - trying to understand wgetch()

I created a single-window menu scheme using ncurses and got it working.
When I added a second window, I can no longer get my wgetch call to fire (or so it seems).
Somewhat confusing to me is the function prototype :
int wgetch(WINDOW *win);
which says wgetch somehow depends on the window but I don't get the relationship - how does "the window" matter? If it does, and I have more than one window, which one do I use? Also, https://linux.die.net/man/3/wgetch says "There is just one input queue for all windows." which tells me "the window" is a "don't care".
Can someone explain?
Thanks.
The window matters because wgetch refreshes the window before reading characters. That's in the wgetch manual page:
If the window is not a pad, and it has been moved or modified since the
last call to wrefresh, wrefresh will be called before another character
is read.
Each window (including stdscr) may have been altered since the last call to wrefresh. If you make changes in one window without refreshing it, and then call wgetch in another window, the changes to the first window are not automatically displayed. You can use wnoutrefresh to combine refreshes, e.g., using that for the first window and then use the wrefresh done automatically for the second window to refresh both.

Apostrophe/Quotation Not Working

This is kind of silly, but the answer is eluding me and the issue is driving me a bit bonkers. Every now and then Excel decides to not let me use ' and " properly, forcing me to press another key before it appears. The thing is, the only solution I can ever find to this problem is changing the keyboard layout. For this very reason, I only have US English as a keyboard option and yet Excel still pulls this prank on me. It's also only Excel doing it, I can type totally normally in web browsers as well as Word.
Is it possible I accidentally hit some setting or something? Is there a way to prevent this from happening? Eventually it just sort of goes away, but it might be days before that happens, so I'm thinking there must be a button I'm bumping on accident that is toggling this setting.

Show only 2 commands in the menu bar in Lwuit or Native J2ME

I added 2 commands to my form in lwuit.
form.addCommand(test);
form.setBackCommand(exitCommand);
I changed the command behavior to COMMAND_BEHAVIOR_NATIVE, so i can show the status, and my commands appear at the bottom too, but they appear exit at the right ..and test Command in the middle.
I want to show only 2 commands layout in the menu bar, Exit on the right and options list that contains test on the left.
How can i do that?
First get the back Command and remove it. After this, add the exit Command like a standard Commandwith addCommand. Try this, if this doesn´t work we can try something else.
I don't know about LWUIT since I've never used it, but with native JavaME you sadly have no control of this. It is the individual device that decides where to place the commands.
You can move them around by changing the priority parameter, and you may be able to achieve an acceptable result that way, but only on some devices. The same code will give a different result on other devices.

Resources