How do you get value or text from an inner-editor shadow element?

I have a form which if you select a user from the dropdown will populate the fields. However these fields are populated into a shadow dom…

It’s a #shadow-root (user-agent)
The div id is:

value here
== $0

I need to capture the value as a variable…how do I do this?

I’ve tried the shadow dom tutorial but that is only for #shadow-root (open)

I’ve tried to set up the objects the same way with the parent and I get an error that the object’s parent is not a shadow root.

I’ve also tried to create the xpath and it’s not working either…

If I set up the object with get attribute value it’s always blank, but I can see it on the page

Got it…

Set up a new object and used double xpath like this:


then I grabbed it and compared it

String editVName = WebUI.getAttribute(findTestObject(‘ST/02 User Editing/03 Fields/00_ShadowDom/03_SDField_LastName’), ‘value’)

WebUI.verifyMatch(editVLName, editVerifyLastName, false, FailureHandling.CONTINUE_ON_FAILURE)

right…so when I first wrote that I was still pretty new. I think the | is an or operator. That doesn’t help. So you can ignore that part. However I was able to capture the value in the shadow dom by utilizing the other part which was “value”

String editVName = WebUI.getAttribute(findTestObject(‘ST/02 User Editing/03 Fields/03_Field_LastName’), ‘value’)

WebUI.verifyMatch(editVLName, editVerifyLastName, false, FailureHandling.CONTINUE_ON_FAILURE)

1 Like