au3WebDriver icon indicating copy to clipboard operation
au3WebDriver copied to clipboard

_WD_ElementOptionSelect and ShadowRoots

Open Danp2 opened this issue 2 years ago • 8 comments

https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/?do=findComment&comment=1505361

Danp2 avatar Jul 30 '22 23:07 Danp2

Yes I know that we must to check it deeply. Thanks for setting this here as an important thing.

mlipok avatar Jul 31 '22 00:07 mlipok

Doesn't this link clearly tell us that it works?

https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/?do=findComment&comment=1505239

image

image

mlipok avatar Mar 03 '23 14:03 mlipok

I don't think so. Are you confusing _WD_ElementSelectAction with _WD_ElementOptionSelect?

Danp2 avatar Mar 03 '23 14:03 Danp2

https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/?do=findComment&comment=1505364

@Zul You may be correct. _WD_ElementOptionSelect is the correct choice, expect when a shadow root is involved.

mlipok avatar Mar 03 '23 14:03 mlipok

I will start with snipped posted here: https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/?do=findComment&comment=1505239

and check if WD_ElementOptionSelect and ShadowRoots works or not.

mlipok avatar Mar 03 '23 15:03 mlipok

Ok, but I'm fairly confident that I already confirmed that it doesn't work when shadowroots are involved.

Danp2 avatar Mar 03 '23 15:03 Danp2

But need to be tested why it works with _WD_ElementSelectAction and not with _WD_ElementOptionSelect? Thus I need to start with comparatable working solution.

mlipok avatar Mar 03 '23 15:03 mlipok

_WD_ElementSelectAction is designed to interact with an element that was previously located via _WD_FindElement. If you look at the code originally posted by @zul, you'll see that it uses _WD_FindElement and _WD_GetShadowRoot to access and locate the target element prior to calling _WD_ElementSelectAction.

_WD_ElementOptionSelect is designed to located then click on a Select element's options. It doesn't yet contain any logic to local Select elements inside a shadow root.

Danp2 avatar Mar 03 '23 17:03 Danp2