Page 1 of 1

Open Chrome Browser with Global Accessibility Mode set 'on'

Posted: Tue Apr 05, 2016 4:57 pm
by Eamonn
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?

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

Posted: Tue Apr 05, 2016 5:20 pm
by krstcs
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.

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

Posted: Tue Apr 05, 2016 5:38 pm
by Eamonn
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?

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

Posted: Tue Apr 05, 2016 8:02 pm
by krstcs
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)

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

Posted: Wed Apr 06, 2016 5:00 pm
by Eamonn
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.).

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

Posted: Thu Apr 07, 2016 9:53 am
by Support Team
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
Please let me know if this resolves the issue.

Sincerely,
Johannes

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

Posted: Tue Apr 12, 2016 3:00 pm
by Eamonn
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.