au3WebDriver
au3WebDriver copied to clipboard
Shadow Root support
https://bugzilla.mozilla.org/show_bug.cgi?id=1489490&GoAheadAndLogIn=1
https://github.com/w3c/webdriver/issues/350#issuecomment-718120114
PR has been submitted to support Shadow Root in the W3C specs. Will update _WD_GetShadowRoot once this gets finalized
_WD_GetShadowRoot has been updated. Still needs to be implemented in geckodriver (https://bugzilla.mozilla.org/show_bug.cgi?id=1700095)
Chromedriver implementation tracking -- https://bugs.chromium.org/p/chromedriver/issues/detail?id=3715
Latest revisions tested successfully with Chrome. Still waiting for Geckodriver to be updated.
Latest revisions tested successfully with Chrome. Still waiting for Geckodriver to be updated.
After it is updated, will it still be necessary to implement corrections in this respect to this UDF? Or are we just waiting to close this ISSUE to test whether the solution introduced into the UDF worked?
I don't believe any further modifications are required, but I'm stating that without reviewing the existing code.
From the Geckodriver 0.31.0 change log --
### Added
- Support for [Get Element Shadow Root]
Implemented by [David Burns].
The standardised WebDriver [Get Element Shadow Root] endpoint provides a way
to retrieve the Shadow Root of a given web element. This endpoint is
supported by geckodriver when using Firefox version ≥96.
The given issue https://github.com/w3c/webdriver/issues/350
has been closed.
How this relates on our work here ?
@mlipok It doesn't change anything. Leaving this open until further testing is performed with the various webdrivers.
_WD_GetShadowRoot seems to be working good on all browsers. Used this code for testing --
Func UserTesting() ; here you can replace the code to test your stuff before you ask on the forum
_WD_Navigate($sSession, "https://component.kitchen/elix/Tabs")
$sRoot = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByXPath, "//elix-tabs[@id='sampleTabs']")
$sDiv = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "#explorerContainer", $sRoot)
$sRoot2 = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "#proxyList", $sDiv)
;~ Exit
EndFunc ;==>UserTesting
@mlipok It doesn't change anything. Leaving this open until further testing is performed with the various webdrivers.
It was game changer, as I see. Now we will be able to close this issue. ;)
Seems to be working good on all browsers. Used this code for testing --
Func UserTesting() ; here you can replace the code to test your stuff before you ask on the forum _WD_Navigate($sSession, "https://component.kitchen/elix/Tabs") $sRoot = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByXPath, "//elix-tabs[@id='sampleTabs']") $sDiv = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "#explorerContainer", $sRoot) $sRoot2 = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "#proxyList", $sDiv) ;~ Exit EndFunc ;==>UserTesting
Will check ASAP. currently on phone
Here is revised code for testing shadow root support in _WD_FindElement --
Func UserTesting() ; here you can replace the code to test your stuff before you ask on the forum
_WD_Navigate($sSession, "https://component.kitchen/elix/Tabs")
$sRoot = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByXPath, "//elix-tabs[@id='sampleTabs']")
$sDiv = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "#explorerContainer", $sRoot, Default, True)
$sRoot2 = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "#proxyList", $sDiv)
;~ Exit
EndFunc ;==>UserTesting```
Firefox
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=xpath Selector=//elix-tabs[@id='sampleTabs'] StartElement=Default
__WD_Post ==> Unknown Command [16] : HTTP status = 405
_WD_FindElement ==> Unknown Command [16] : Parameters: Strategy=css selector Selector=#explorerContainer StartNodeID=fe590b11-4957-4f21-b5d9-99351b274625 Multiple=Default ShadowRoot=True
__WD_Post ==> No match [8] : HTTP status = 404
_WD_FindElement ==> No match [8] : Parameters: Strategy=css selector Selector=#proxyList StartNodeID= Multiple=Default ShadowRoot=Default
_WD_GetShadowRoot ==> No match [8] : Parameters: Strategy=css selector Selector=#proxyList StartElement=
Chrome
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=xpath Selector=//elix-tabs[@id='sampleTabs'] StartElement=Default
__WD_Post ==> Success [0] : HTTP status = 200
_WD_FindElement ==> Success [0] : Parameters: Strategy=css selector Selector=#explorerContainer StartNodeID=eab9f36b-9864-461e-8d7e-2719ffd6e395 Multiple=Default ShadowRoot=True
__WD_Post ==> Success [0] : HTTP status = 200
_WD_FindElement ==> Success [0] : Parameters: Strategy=css selector Selector=#proxyList StartNodeID=f3d9344d-6410-4e3a-a68f-6947f1f099d9 Multiple=Default ShadowRoot=Default
__WD_Get ==> Success [0] : HTTP status = 200
_WD_ElementAction ==> Success [0] : Parameters: Command=shadow Option=Default
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=css selector Selector=#proxyList StartElement=f3d9344d-6410-4e3a-a68f-6947f1f099d9
Edge
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=xpath Selector=//elix-tabs[@id='sampleTabs'] StartElement=Default
__WD_Post ==> Success [0] : HTTP status = 200
_WD_FindElement ==> Success [0] : Parameters: Strategy=css selector Selector=#explorerContainer StartNodeID=9d37a423-0a74-489a-96b2-14afaee431ec Multiple=Default ShadowRoot=True
__WD_Post ==> Success [0] : HTTP status = 200
_WD_FindElement ==> Success [0] : Parameters: Strategy=css selector Selector=#proxyList StartNodeID=1554f194-8ce4-4314-967b-96e8c8c0467e Multiple=Default ShadowRoot=Default
__WD_Get ==> Success [0] : HTTP status = 200
_WD_ElementAction ==> Success [0] : Parameters: Command=shadow Option=Default
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=css selector Selector=#proxyList StartElement=1554f194-8ce4-4314-967b-96e8c8c0467e
Opera
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=xpath Selector=//elix-tabs[@id='sampleTabs'] StartElement=Default
__WD_Post ==> Success [0] : HTTP status = 200
_WD_FindElement ==> Success [0] : Parameters: Strategy=css selector Selector=#explorerContainer StartNodeID=f29e3910-7255-4b26-abb1-b98bbcbc9118 Multiple=Default ShadowRoot=True
__WD_Post ==> Success [0] : HTTP status = 200
_WD_FindElement ==> Success [0] : Parameters: Strategy=css selector Selector=#proxyList StartNodeID=2a4028a4-f4ef-4b91-b4af-ef7419649108 Multiple=Default ShadowRoot=Default
__WD_Get ==> Success [0] : HTTP status = 200
_WD_ElementAction ==> Success [0] : Parameters: Command=shadow Option=Default
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=css selector Selector=#proxyList StartElement=2a4028a4-f4ef-4b91-b4af-ef7419649108
Firefox functionality still depends on bug 1700095
Here is revised code for testing shadow root support in _WD_FindElement --
Func UserTesting() ; here you can replace the code to test your stuff before you ask on the forum _WD_Navigate($sSession, "https://component.kitchen/elix/Tabs") $sRoot = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByXPath, "//elix-tabs[@id='sampleTabs']") $sDiv = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "#explorerContainer", $sRoot, Default, True) $sRoot2 = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "#proxyList", $sDiv) ;~ Exit EndFunc ;==>UserTesting```
Here is a screenshot for reference:
All looks fine (expect mentioned FF bug).
Please consider adding this snippet to wd_demo.au3 as DemoShadow
function.
I'd prefer to leave this out of wd_demo for the following reasons --
- This is an advanced feature that most users won't need
- Adds maintenance to project due to changing web pages
The wiki may be a better option.
So do you whether you intend to close this ticket or mark it as awaiting feedback
(gecko driver fix for FF)
There are some changes in: https://bugzilla.mozilla.org/show_bug.cgi?id=1700095
Maybe soon will be fixed.
Related: https://bugzilla.mozilla.org/show_bug.cgi?id=1821628 https://phabricator.services.mozilla.com/D172416#5677925
Is this related to our case ? https://github.com/w3c/webdriver/pull/1726
@mlipok Seen it. That's why I made the change in #441 😉
_WD_GetShadowRoot has been updated. Still needs to be implemented in geckodriver (https://bugzilla.mozilla.org/show_bug.cgi?id=1700095)
Looks like this fix just landed for Firefox. Will need to confirm once v113 is released.
Geckodriver has been updated. FF v113 is still a month from release, but it can be tested using the Nightly release.
Geckodriver has been updated. FF v113 is still a month from release, but it can be tested using the Nightly release.
https://github.com/mozilla/geckodriver/releases/tag/v0.33.0 https://www.autoitscript.com/forum/topic/208633-webdriver-udf-w3c-compliant-version-20230326/?do=findComment&comment=1516289
version 112 was released. https://www.mozilla.org/en-US/firefox/112.0/releasenotes/
https://www.mozilla.org/en-US/firefox/releases/
Please also take a look here: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/112
Element and ShadowRoot references as stored in the node cache can now be used in both Marionette and WebDriver BiDi by their exact same unique reference. See [Firefox bug 1770733](https://bugzil.la/1770733) for more details.
as to FF 113 (ships on [May 09, 2023]) https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/113
This article provides information about the changes in Firefox 113 that affect developers. Firefox 113 is the current [Beta version of Firefox](https://www.mozilla.org/en-US/firefox/channel/desktop/#beta) and ships on [May 09, 2023](https://wiki.mozilla.org/RapidRelease/Calendar#Future_branch_dates).
Tested with FF113 --
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=xpath Selector=//elix-tabs[@id='sampleTabs'] StartElement=Default
__WD_Post: URL=HTTP://127.0.0.1:4444/session/f805a670-be99-4523-8b62-a21ecc2870ca/shadow/46cf3f8b-e03e-48a1-b6ee-f5e95eb549a4/element; Data={"using":"css selector","value":"#explorerContainer"}
__WD_Post ==> Success [0] : HTTP status = 200 ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"42100b60-523e-4068-b763-c3b88bb67b61"}}
_WD_FindElement ==> Success [0] : Parameters: Strategy=css selector Selector=#explorerContainer StartNodeID=46cf3f8b-e03e-48a1-b6ee-f5e95eb549a4 Multiple=Default ShadowRoot=True
__WD_Post: URL=HTTP://127.0.0.1:4444/session/f805a670-be99-4523-8b62-a21ecc2870ca/element/42100b60-523e-4068-b763-c3b88bb67b61/element; Data={"using":"css selector","value":"#proxyList"}
__WD_Post ==> Success [0] : HTTP status = 200 ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"4da05632-0626-41ca-9cda-4cabe6ce1449"}}
_WD_FindElement ==> Success [0] : Parameters: Strategy=css selector Selector=#proxyList StartNodeID=42100b60-523e-4068-b763-c3b88bb67b61 Multiple=Default ShadowRoot=Default
__WD_Get: URL=HTTP://127.0.0.1:4444/session/f805a670-be99-4523-8b62-a21ecc2870ca/element/4da05632-0626-41ca-9cda-4cabe6ce1449/shadow
__WD_Get ==> Success [0] : HTTP status = 200 ResponseText={"value":{"shadow-6066-11e4-a52e-4f735466cecf":"5b186fb5-be7c-4c64-9bed-450d9294e12e"}}
_WD_ElementAction ==> Success [0] : Parameters: Command=shadow Option=Default
_WD_GetShadowRoot ==> Success [0] : Parameters: Strategy=css selector Selector=#proxyList StartElement=42100b60-523e-4068-b763-c3b88bb67b61