public void setKeyboardOptions ( ) { File folder = new File ( contentAndSettingsFolder + "/Library/Preferences/" ) ; File preferenceFile = new File ( folder , "com.apple.Preferences.plist" ) ; try { JSONObject preferences = new JSONObject ( ) ; preferences . put ( "KeyboardAutocapitalization" , false ) ; preferences . put ( "KeyboardAutocorrection" , false ) ; preferences . put ( "KeyboardCapsLock" , false ) ; preferences . put ( "KeyboardCheckSpelling" , false ) ; writeOnDisk ( preferences , preferenceFile ) ; } catch ( Exception e ) { throw new WebDriverException ( "cannot set options in " + preferenceFile . getAbsolutePath ( ) , e ) ; } }
the default keyboard options aren t good for automation . For instance it automatically capitalize the first letter of sentences etc . Getting rid of all that to have the keyboard execute requests without changing them .