While using screen reader such as NVDA, how to press Left or Right key? - keyboard-shortcuts

While using screen reader such as NVDA, when left or right key is pressed, the screen reader reads the current or next element letter by letter.
If anybody knows how can I press left or right key to trigger the element's keypress event?
Thanks.

A screen reader has two modes: browse mode (where keyboard events are sent to the screen reader) and forms mode (where keyboard events are sent to the html element).
The default setting for most screen readers is to have automatic switching between the two modes for certain types of html elements, although you can manually switch between the two modes as well.
So the key to having keyboard events sent to your element is to use the right html element (these are elements that require keyboard focus management) or use the role for that element.
The following elements will automatically switch between browse mode (arrow key reading the next character) and forms mode (the html element handling the arrow key):
Combobox
Grid
Listbox
Menu or menu bar
Radiogroup
Tabs
Toolbar
Tree Grid
Tree View
Some of these elements have a native html element (eg, <input type='radio'>) but others require the role (eg, <div role='tablist'>).
If your component doesn't fall into one of these widgets, then you can use role="application" but I always caution about using that role. It's often misused and can make a website difficult to use for a screen reader user if the role isn't used correctly.

Related

How to unfocus from all inputs/elements in Selenium without tabbing out

I have a form where I fill in textboxes through selenium (java). Some of the textboxes dynamically generate extra content when you click on them and remove the content when you focus on something else. This is a problem when I automate because if I am focused on a text box and try to click on something else, when the page removes the content it doesn't register my click and I need to click again. This leads to flakey behaviour since I need to now consider whether I need to click or double click a button depending on what element I was focused on before.
I can't send a tab key to the text box because sometimes it will tab into another textbox that has the same dynamic generation behaviour, leading to the same scenario as before.
I tried clicking the page element but it also doesn't seem to work. I also tried clicking the root div. It just doesn't seem to register my click (I also tried jsclicks)
What I would like to do is have a general way to unfocus a text box after I fill it.
Thanks!

Global Send Keys - Blue Prism

I am trying to use global send keys to press "Down" and then "Enter", however the element that I am trying to spy loses functionality if I use the UI Automation mode every time.
So my question is if I spy my element with the HTML mode is there still a way to use the Global Send Keys as so far it I can only see the option to use them if the UI mode is used for spying.
Any solutions would be greatly appreciated.
Thanks
Bit of incorrect information going on in this page so doing some work to steer people correctly here and then provide solution to OP's problem;
SendKeys are only utilised by the following attributes as of v6.4
UI Elements:
Button (UIA) elements
Check Box (UIA) elements
Radio Button (UIA) elements
Combo Box (UIA) elements
Edit Box (UIA) elements
Menu (UIA) elements
Menu Item (UIA) elements
List (UIA) elements
List Item (UIA) elements
Table (UIA) elements
Tab Control (UIA) elements
Tab Item (UIA) elements
Hyperlink (UIA) elements
Tree View (UIA) elements
Tree View Item (UIA) elements
Window (UIA) elements
Active Accessibility Elements:
Button (AA) elements
Combo Box (AA) elements
List Box (AA) elements
Edit (AA) elements
And lastly
Application elements (what some people call the root element)
SAP Main Windows
These are the only places you can use Send Keys.
As for Send Key events, these are for utilizing send keys typically on thin client applications like Citrix. A great explanation is posted here:
https://www.rpaforum.net/threads/global-send-keys-and-send-key-events.1587/
Also there is a data sheet on Send Keys called 'Guide to Send Keys and Send Key Events on the Blue Prism portal would recommend you read it. For the purposes of answering here to Op's various questions.
If you spy with HTML mode you can't use a HTML element to invoke Send Keys. You can use the root application sure but not the actual spied element. There is a sequence of events you could try where you use HTML/AA/similar to click the element you are targeting and then afterwards utilise either an element listed above or the root element to invoke send keys to perform the task you are looking for. In this case teh task you are trying to do in send keys is
{DOWN}
for the down arrow or
{PGDN}
for page down if you wanted instead and then
{ENTER}
for the enter function
As stated by Blue Prism and other resources unless you absolutely need to do not use Send Key Events, it is not preferred.
Yes, using a navigate stage Blue Prism allows for Global Send Keys to be utilized on elements spied in HTML mode.
This is especially useful/necessary when interacting with generatively constructed DOMs that like to mimic ractive front-end (looking at you SharePoint 2019).
Case-in-point: A dropdown that holds no values until clicked, at which point the JavaScript 'onclick' binding or shadow-DOM is activated to return the values. Thus these dropdown values are unavailable to spy/map in any consistent way, so you'd need to "navigate" and select based on Global Send Keys.

In IntelliJ IDEA, how do I use the keyboard to highlight an arbitrary checkbox?

For example, if I press Ctrl-Alt-P to extract a parameter, pressing Tab on the resulting dialog box moves directly from "Name" to "Refactor". I know I can work around this by using Alt+key to select a checkbox (e.g., Alt+a for replace all), but as AltGr doesn't work I have to contort my left hand to hit this combination. How do I, using the keyboard, select the first checkbox, so I can use space to change it?
The only way to access the checkboxes in this dialog is via mnemonics (Alt+underlined letter).
There is also an open issue to add tabstops for checkboxes and radio buttons in the refactoring dialogs so that they can be accessed not only by the mnemonics, but also by cycling the components using Tab:
IDEA-154127 Extract refactorings: navigation and mnemonics problems
There is really nothing you can do about it until tabstops are explicitly implemented for these dialogs.

Which changes count as "content changes" in Mobile Safari that prevent mousedown, mouseup, and click events?

As documented in the Safari Web Content Guide, certain changes made to the document in a mouseover or mousemove handler will prevent mousedown, mouseup, and click events from firing on the element:
Is there a complete list of changes to the document that count as "content changes"?
I don't have a complete list, but here are some changes that count as content changes, and others that do not count as content changes:
Content changes
Call appendChild()
http://fiddle.jshell.net/EDB3b/show/
Reveal an element hidden by display:none
http://fiddle.jshell.net/EDB3b/3/show/
Reveal an element hidden by visibility:hidden
http://fiddle.jshell.net/EDB3b/4/show/
Non-content changes
Set innerHTML
http://fiddle.jshell.net/EDB3b/1/show/
Call insertAdjacentHTML()
http://fiddle.jshell.net/EDB3b/2/show/
Set outerHTML
http://fiddle.jshell.net/EDB3b/5/show/
Change the text color
http://fiddle.jshell.net/EDB3b/6/show/
Add a class
http://fiddle.jshell.net/EDB3b/7/show/
Hide an element via display:none
http://fiddle.jshell.net/EDB3b/8/show/
Hide an element via visibility:hidden
http://fiddle.jshell.net/EDB3b/9/show/
Call removeChild()
http://fiddle.jshell.net/EDB3b/10/show/
See also
How Mobile Safari emulates mouse events
The iOS event cascade and innerHTML

Give focus to text-entry field in prompt in node-webkit

In most browsers, a javascript prompt() gives focus to the text entry field so the user can begin typing immediately.
In node-webkit, a javascript prompt() gives focus to the prompt window, but not the text entry field. The user has to click inside the field before typing.
How can I set the focus to inside the text entry field when using a prompt in node-webkit?
An extensible way is to create your own prompts with a javascript modal window. Many of the common JS frameworks have easy ways of creating a modal window which will give you complete control over the text and inputs being displayed.