23-01-24 01:23 PM
Hello,
I am trying to select from a date Picker window within Chrome. I previously tried writing the date in the field using both a write stage and Global Send Keys, however the digits are scrambled.
I have devised multiple methods for selecting the correct date, the one I landed on being dynamically setting the Xpath attribute for the desired date. I know this works because I can highlight the desired date by using the "Select" Action within the navigate stage.
When I try to use the "Click" action on the desired date, however, nothing happens...
I have tried making it focus on the element before clicking, using the "Double Click" Action, changing the Element Type from "Table Item" to "Web Element". There is no Global Mouse click action available for this element.
What can I do from here? Any help would be greatly appreciated.
23-01-24 06:01 PM
Calendars are a nightmare Ben, so try everything you can before resorting to spying the calendar elements. You can replicate a Global Click with a workaround - it's a bit of pain, but it works.
Note that this method assumes the element is visible and not scrolled off page.
24-01-24 02:17 PM
@Ben_Scholefield_Everflow, almost ANY HTML element can always be clicked in this way, though might have to make use of ScrollTo as well (as John said, for those off the screen).
IF the page has iframes and your content lies in an iframe, you'll have to click relative to the iframe (not the main over-arching HTML body), otherwise you'll click in the wrong position.
UIA is good enough usually to capture the iframe.
re SendKeys and scrambled characters, I think there's a fix for that in later BP versions, but in any case, you can put an interval of about 0.3 seconds as the other parameter to Send Keys.
Using the clipboard and Ctrl-V is another hack - for those fields that allow paste.
24-01-24 05:57 PM
Have you tried changing the format of the date you are writing to the field? We had a date field that needed the date formatting as yyyy/MM/dd before writing and it would then flip it to dd/MM/yyyy and accept it. Try reading the date field and see what format it comes out in, it may not be the same as is displayed.