Open Chrome Browser with Global Accessibility Mode set 'on'

Ask general questions here.
Eamonn
Posts: 59
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Open Chrome Browser with Global Accessibility Mode set 'on'

Post by Eamonn » Tue Apr 05, 2016 4:57 pm

I wish to open the chrome browser on a URL with the Global accessibility Mode set to 'on'.

The flag is --force-renderer-accessibility.

Who might I do this?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Open Chrome Browser with Global Accessibility Mode set 'on'

Post by krstcs » Tue Apr 05, 2016 5:20 pm

If you are wanting to do this in a recording module, you will likely need to convert the Browser.Open() action into a usercode method (right-click -> Convert to usercode). Then, double-click the UserCode action and Ranorex will open the *.UserCode.cs file that corresponds to the recording module and will take you right to the new method.

Then, you can change the parameters in code. You can also pass the values you want in at runtime by creating variables in the test module and binding them to Global Parameters or data connector columns.
Shortcuts usually aren't...

Eamonn
Posts: 59
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Re: Open Chrome Browser with Global Accessibility Mode set 'on'

Post by Eamonn » Tue Apr 05, 2016 5:38 pm

Krstcs, thank you, your advice sounds as the best direction for me to take. Can you advise me on how to code the *.UserCode.cs to set the flag --force-renderer-accessibility to on?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Open Chrome Browser with Global Accessibility Mode set 'on'

Post by krstcs » Tue Apr 05, 2016 8:02 pm

If you do what I suggested (right-click -> Convert to Usercode), and then double-click the new Usercode action, it will take you to the code. Just mouse-over the command and it will show you the parameters. Then insert your parameter ("--force...") in the correct spot (see below: "browserArgs").

Code: Select all

Host.Local.OpenBrowser(URL, browserName, browserArgs, true, true, false, true, false)
Shortcuts usually aren't...

Eamonn
Posts: 59
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Re: Open Chrome Browser with Global Accessibility Mode set 'on'

Post by Eamonn » Wed Apr 06, 2016 5:00 pm

I have been following your advice, however, when I check on Chrome://accessibility/ the Global Accessibility Mode is not set to 'on' nor is the accessibility mode set to 'on' for the webpage opened.
The ranorex module I am using to action the Run button in the Chrome Developer Tool to run the accessibility audit report can not find the element. But when I manually turn on the Global Accessibility Mode, the ranorex module can local the Run element and action the Audit Report.

line in my .UserCode.cs is:
Host.Local.OpenBrowser("https://****************.com/", "Chrome", "--args --force-renderer-accessibility", false, true, false, false, false);

This is failure report for the action item:

Attribute 'Visible' of element for item 'ADA_ComplianceTestsRepository.Chrome_*************.DeveloperTool.AccessibilityTitle' does not match the specified value (Failed to find item 'ADA_ComplianceTestsRepository.Chrome_************.DeveloperTool.AccessibilityTitle'. No element found for path '/form[@title~'^*****************]/element[@controlid>='0']/container[@accessiblerole='Document']/?/?/container[@accessiblerole='Grouping']//text[@accessiblename='Accessibility']' within 1m.).

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Open Chrome Browser with Global Accessibility Mode set 'on'

Post by Support Team » Thu Apr 07, 2016 9:53 am

Hello Eamonn,

If you start Chrome with the force-renderer-accessibility flag, please make sure that there is no active instance of Chrome at this moment. Otherwise, the flag doesn't activate the global accessibility mode.

For that to happen, please disable the option Continue running background apps when Google Chrome is closed in the advanced settings of your Chrome browser.
chrome_advanced_settings.png
chrome_advanced_settings.png (11.53 KiB) Viewed 3355 times
Please let me know if this resolves the issue.

Sincerely,
Johannes
.
Image

Eamonn
Posts: 59
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Re: Open Chrome Browser with Global Accessibility Mode set 'on'

Post by Eamonn » Tue Apr 12, 2016 3:00 pm

Firstly, I was missing '--user-data-dir' in the arguments.
Secondly, there may have been active instances of Chrome.

I am now using the Kill method to stop all Chrome processes.

Thank you for the information, it has been very helpful.

Your point on unsetting the Continue running background apps when Google Chrome is closed is very useful. But I believe the Kill() will do the same, albeit in a more unrefined manner. But I fear if someone else id running my tests on there machine they may not have remembered to unset this on their browser application.