I have a Flutter App which I’m testing against… I am using the Browser Library because everything is in the Shadow DOM… The picture shows a Calendar field which I’d like to pull the date from:
Nowhere in the above html does it provide the value of the Date. There’s an input field there, but I haven’t found a way to pull the current date value…
I’ve targeted the field with the below:
${attributes}= Get Attribute Names [aria-label=“Select a Date to Play”]
Which returns the following attributes:
16:48:28.438 INFO Attributes: [‘spellcheck’, ‘autocorrect’, ‘autocomplete’, ‘data-semantics-role’, ‘aria-label’, ‘style’]
No value attribute to query
Anyone have any suggestions?
I can click the field and then access the data value (since it’s in the title of the Calendar popup) and then cancel the click, but I’d like to do it without the click.
Thanks…
Hi Dave,
Yes that is what I’m after… I have to use the css selector since this is within the Shadow Root. I have tried the following…
${tee_date}= Get Attribute input[aria-label=“Select a Date to Play”] value
Which gives the following error:
AttributeError: Attribute ‘value’ not found!
So I’m not sure how to get the value from the input field…
Based on that error it seems your css selector is correct, sorry don’t use css selectors much I only recently learned about them, so the next thing I’d try is use that selector with Get Text
${DateToPlay}= Get Text //input[@aria-label="Select a Date to Play"]
Hi Dave,
I ran the Get Text and all it returns is: Text: ‘’
It’s very odd where it must store the value, but it is a Flutter App so it does some odd things within the Web Canvas…
Julian
I have seen web apps that use java script actions on input fields when you change the field value it runs some validation on the input and then moves the data to another element in the page often a hidden div or input. Maybe flutter does something like that, I’m not familiar with flutter.
If you have access to the dev team maybe they can help you identify what’s happening and what you need to do to test this app?
Is the site on the internet? If you give a URL we can have a peek and try to figure it out.
Hi Dave,
I couldn’t give access to the app, however I have built a working problem for two fields the Calendar and a List…
The list has I’m guessing the same issue where the currently selected one has a value but any unselected doesn’t which makes it difficult to select a specific value from the list.
I put a Click button on the app so you can have something to click in the test and get a result.
App is here:
Flutter is write once run anywhere code, and on the Web under the covers it does indeed convert the flutter/dart code down to JavaScript… So I suspect your supposition that there is a script action is likely correct, however I’ve not done much with JavaScript so don’t know if there’s a way to hook that somehow to get the values…
The JavaScript it compiles down to is here: https://robotframeworktest-f7670.web.app/main.dart.js