With the latest version of WebdriverIO (WDIO) I would like to enter text in a field and not have the value appear in the default logs.
I would be using the DevTools solution through WDIO and the secure data entry model is required for password and credit card information etc so we do not inadvertently declare the strings in the log files.
Options explored:
- Tried setValue, but the string values are clearly captured in the log files.
- Tried modifying the logLevel at run time however once the WDIO test session has started I cannot modify the logLevel.
- Setting logLevel to ‘silent’ stops the log from appearing but all other logging is also stopped.
- With the driver.execute scripts I attempted setting the type of the input to
passwordbut that only resulted in the ui display masking the characters (good for screen capture prevention though) and also tried updating the value but the full execute string is captured in the logs.
So really, it’s pretty easy to stop logging in console but the default wdio-0-0.log is only modifiable via the logLevel parameter in capabilities and that halts all logging and can’t just be “paused”.
Hopefully I have missed a simple way to solve this online but so far my search is fruitless.