Unable to clear a (material ui 5) datepicker field on Firefox - works fine on Edge and Chrome
We have several date fields in our system, implemented using Material UI 5.10.2 datepicker. Our system is tested on Edge, Chrome and Firefox.
We have some tests that clear the text component part of the datepicker field using SetText("").
This is working fine on Edge and Chrome however on Firefox it does not clear the field. I have also tried using Keys("") followed by a Keys("[Tab]"], which does not work either
Has anyone else come across this or anything similar to this?
Any ideas how I can clear the field in Firefox?
Solved! Go to Solution.
Actually, .Keys("") does nothing, so I am not surprised that the field is not cleared. (To press Space key you should call .Keys(" ") -- space between quotes.)
What if you give a try to something like:
obj.Click(); // to set input focus into control;
obj.Keys("^A"); // Control-A to select all text (or "[Home]![End" -- Home, then Shift-End for the same purpose, or anything else that will select all text within control
obj.Keys("[Del]"); // Delete to clear the control
Does it help?
/Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
obj.Keys("^A"); didn't work for me on Firefox, it opened a new tab with showing add-ons
however, this did work.