Push on Android search button with Calabash - cucumber

I have this problem: I'm testing an Android app who's using a search box embedded in an Edit Text, so it's not a typical "search" controller but in the keyboard the search button appear. I'm using Calabash to write the tests.
This is the test:
Scenario: Iniciar la aplicación y realizar búsquedas
And I wait for "Música" to appear
Then I press view with id "menu_search"
Then I enter text "Judas Priest" into field with id "collapsibleEditText"
Then I press "search"
The execution return this error:
And I wait for "Música" to appear
Then I press view with id "menu_search"
Then I enter text "Judas Priest" into field with id "collapsibleEditText"
Then I press "search"
Timeout waiting for elements: * marked:'search' (Calabash::Android::WaitHelpers::WaitError)
features/test.feature:11:in `Then I press "search"'

You should use the method press_user_action_button to press the 'search' button appearing on the keyboard. Pressing the enter key (press_enter_key) is not what a user would do, unless the device has a physical keyboard. You can read more about how Android is handling the special keyboard 'enter keys' (user action buttons) here.

With the step "Then I press "search"" it will search for UI elements with that label. But that does not include the keyboard.
There are 2 options
Something like
Then /^I press the enter button$/
Or something like this
keyboard_enter_keyevent('KEYCODE_ENTER')
(This is copied from Krazy Robot)

I copy the fix to the problem.
I've create a new step definition in my scenary
Scenario
.... nothing changed from the question above
Then I press search button
And in the features/step_definitions/calabash_steps.rb
Then /^I press search button$/ do
press_enter_button
end
And it works

Related

What is the purpose of the Look Up button on a Logitecth MX Keys Keyboard?

Everything is in the title. I wonder if anyone knows how to use the Look Up button on a Logitech Mx Keys. I saw in Logitect Options that it does a look up but what does that mean exactly? Any idea?
I'm talking about the button surrounded by red in this picture.
In Mac OS, you can highlight a word and press the Look Up button to see the definition pop up in Chrome. I believe this is the same action as selecting a word, right clicking it, then pressing on the Look Up "...." option.
You can also press the fn key with the Look Up button to toggle scroll lock.

Enabling keyboard shortcuts to confirm Dialogs in AppleScript

I am looking for a way to allow a user to complete a Dialog entry using keyboard shortcuts. Is this possible?
Other questions have discussed assigning shortcuts to the options in an AppleScript dialog box, but not to the "Continue"/"Okay" etc. button.
The main difficulty is that I'm using a multi-line text entry form, so the Enter button simply creates a new line, instead of targeting the default button as it would conventionally. I'm hoping cmdenter can be assigned to the default button instead.
The line of script defining the dialog in question is:
set theResponse to display dialog "Enter tasks:" default answer "
" buttons {"Cancel", "Continue"} default button "Continue"
Running your AppleScript code from Script Editor on a US English MacBook Pro, whether or not something is typed in, fnenter presses the Continue button.
The same keyboard shortcut works on an US English Apple Magic Keyboard when connected to the MacBook Pro and I'd assume any US English Mac it was connected to would do the same. I only have the MacBook Pro to test with at the moment.
In macOS, by default, pressing the tab key in this use case will not move between the controls as the controlling setting in System Preferences > Keyboard > Shortcuts is not set to allow it to act on all controls.
You must select one of the following options, depending on the version of macOS one is running, in order to use the tab key on all controls.
If you see:
Full Keyboard Access: In windows and dialogs, press Tab to move keyboard focus between:
(•) Text boxed and lists only
( ) All Controls
Select: (•) All Controls
If you see:
[] Use keyboard navigation to move between controls
Press the Tab key to move focus forward and Shift Tab to move focus backward.
Check: [√] Use keyboard navigation to move between controls
With this done, one can then use tabtabenter to press the continue button, with the dialog box produced by the code shown in the OP.
Side Note: One can also try fncommandenter as that was necessary from within a VMware macOS Catalina virtual machine that I also tested in.
⌘-Enter (on the numeric keypad) presses Continue
If you are in a multiline text field, hit the Tab key so that focus is on some element other than the text field. Then the Enter key should route properly to the dialog's default close button.

Firemonkey: Change Virtual Keyboard Enter button according to edit

I'm using RadStudio 10.1 Berlin and I'm tryng to change the Key Enter of my Virtual Keyboard when search edit is pressed. Now what I get is this enter button:
But I want change for something like this:
or this:
or this
I know about the keyboardType option on the inspector, but there's nothing there about search, or next. Just E-mail, phonenumber, alphabetic, default etc...
Only change ReturnKeyType = Next for example.

Sublime text 3 find and replace in selection without clicking the button

I'm using ST3 with vintage mode. When selecting some lines and pressing alt+shift+f (Mac OSX) I get the find and replace dialog at the bottom of the screen.
BUT, I have to remove my hand from the keyboard, reach for the mouse and click the little "In selection" button...
...is there some way for sublime to realize that I have made a selection and have that button clicked by default?
Try setting:
"auto_find_in_selection": true,
From my understanding, this will automatically use 'in selection' if you have non-empty selection when goes into find box.
[Edit]
Note, you generally set this settings in "Preferences.sublime-settings". You can open this setting by "Ctrl+Shift+P", and select "Preferences: Settings - User".

Move command in Dialog based aplications

I working on Dialog based applications once i right click on the Dialog Title bar a drop down list is coming with two options 1. Move and 2. Alt+F4 close. Once the User Press Move and he can able to drag the window as he desired and I add the On NC Hits Test to stop dragging its stopping normal dragging but it is not working in this particular context can any body help me in fixing this Bug.
When the user use the keyboard interface, he can move a windows with the arrow keys, without using the mouse.
If you want to limit the position of your dialog, process the WM_MOVING message.

Resources