How to allow to disable the mouse cursor in chrome with selenium?

Viewed 1574

I'm trying to test a site with selenium (in java) which disables the mouse cursor at some point. During the test when the site tries to disable the mouse cursor, Chrome is waiting for the user to allow or not to disable the mouse pointer so the test can't finish correctly without user action. I had a similar problem with the notification "the site wants to store data in your device" but I solved with the option "--unlimited-storage".

My question is how can do the same for mousecursor option for Chrome? Here my code:

ChromeOptions options = new ChromeOptions();
options.setBinary(CHROME_EXE);
options.addArguments("--start-maximized");
options.addArguments("--unlimited-storage");
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("profile.content_settings.mouselock",0);//Also tried with "default_content_settings"
options.setExperimentalOption("prefs", prefs);
WebDriver driver = new ChromeDriver(options);

I've tried the same with cookies to see if it's working but nothing.

prefs.put("profile.default_content_settings.cookies",0);//Also tried with 1 and 2 but the settings didn't change

Here some other piece of code I've tried:

Map<String, Object> prefs = new HashMap<String, Object>();
Map<String, Object> pattern = new HashMap<String, Object>();
Map<String, Object> excep = new HashMap<String, Object>();
excep.put("setting", 1);//Tried also with 0
pattern.put("[*.].mysite.com,*", excep);
prefs.put("profile.default_content_settings.exceptions.mouselock",pattern);

Any idea about how to set up chrome preferences (that works) in the ChromeDriver, please?

Thanks in advance for any response.

0 Answers
Related