Skip to content

Shadow Root support #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Danp2 opened this issue Sep 26, 2019 · 30 comments
Closed

Shadow Root support #26

Danp2 opened this issue Sep 26, 2019 · 30 comments

Comments

@Danp2
Copy link
Owner

Danp2 commented Sep 26, 2019

https://bugzilla.mozilla.org/show_bug.cgi?id=1489490&GoAheadAndLogIn=1

@Danp2
Copy link
Owner Author

Danp2 commented Oct 28, 2020

@Danp2
Copy link
Owner Author

Danp2 commented Jan 10, 2021

PR has been submitted to support Shadow Root in the W3C specs. Will update _WD_GetShadowRoot once this gets finalized

@Danp2
Copy link
Owner Author

Danp2 commented Jan 28, 2021

_WD_GetShadowRoot has been updated. Still needs to be implemented in geckodriver (https://bugzilla.mozilla.org/show_bug.cgi?id=1700095)

@Danp2
Copy link
Owner Author

Danp2 commented Mar 5, 2021

Chromedriver implementation tracking -- https://bugs.chromium.org/p/chromedriver/issues/detail?id=3715

@Danp2 Danp2 changed the title _WD_GetShadowRoot doesn't work in Firefox _WD_GetShadowRoot improvements Mar 8, 2021
@Danp2
Copy link
Owner Author

Danp2 commented Dec 25, 2021

Latest revisions tested successfully with Chrome. Still waiting for Geckodriver to be updated.

@mlipok
Copy link
Contributor

mlipok commented Jan 7, 2022

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?

@Danp2
Copy link
Owner Author

Danp2 commented Jan 7, 2022

I don't believe any further modifications are required, but I'm stating that without reviewing the existing code.

@Danp2
Copy link
Owner Author

Danp2 commented Apr 11, 2022

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.

@mlipok
Copy link
Contributor

mlipok commented Jul 13, 2022

The given issue
w3c/webdriver#350

has been closed.

How this relates on our work here ?

@Danp2
Copy link
Owner Author

Danp2 commented Jul 13, 2022

@mlipok It doesn't change anything. Leaving this open until further testing is performed with the various webdrivers.

@Danp2
Copy link
Owner Author

Danp2 commented Jul 14, 2022

_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
Copy link
Contributor

mlipok commented Jul 14, 2022

@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.
;)

@mlipok
Copy link
Contributor

mlipok commented Jul 14, 2022

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

@Danp2 Danp2 changed the title _WD_GetShadowRoot improvements Shadow Root support Jul 17, 2022
@Danp2
Copy link
Owner Author

Danp2 commented Jul 17, 2022

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```

@Danp2
Copy link
Owner Author

Danp2 commented Jul 17, 2022

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

@Danp2
Copy link
Owner Author

Danp2 commented Jul 17, 2022

Firefox functionality still depends on bug 1700095

@mlipok
Copy link
Contributor

mlipok commented Jul 18, 2022

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:
image

@mlipok
Copy link
Contributor

mlipok commented Jul 18, 2022

All looks fine (expect mentioned FF bug).

Please consider adding this snippet to wd_demo.au3 as DemoShadow function.

@Danp2
Copy link
Owner Author

Danp2 commented Jul 18, 2022

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.

@mlipok
Copy link
Contributor

mlipok commented Jul 18, 2022

So do you whether you intend to close this ticket or mark it as awaiting feedback (gecko driver fix for FF)

@Danp2 Danp2 added the upstream issue with upstream webdriver label Jul 18, 2022
Repository owner deleted a comment from mlipok Jul 28, 2022
Repository owner deleted a comment from mlipok Jul 28, 2022
@mlipok
Copy link
Contributor

mlipok commented Mar 14, 2023

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

@mlipok
Copy link
Contributor

mlipok commented Mar 16, 2023

Is this related to our case ?
w3c/webdriver#1726

@Danp2
Copy link
Owner Author

Danp2 commented Mar 16, 2023

@mlipok Seen it. That's why I made the change in #441 😉

@Danp2
Copy link
Owner Author

Danp2 commented Mar 17, 2023

_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.

@Danp2
Copy link
Owner Author

Danp2 commented Apr 3, 2023

Geckodriver has been updated. FF v113 is still a month from release, but it can be tested using the Nightly release.

@mlipok
Copy link
Contributor

mlipok commented Apr 5, 2023

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

@mlipok
Copy link
Contributor

mlipok commented Apr 12, 2023

@mlipok
Copy link
Contributor

mlipok commented Apr 12, 2023

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.

@mlipok
Copy link
Contributor

mlipok commented Apr 12, 2023

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).

@Danp2
Copy link
Owner Author

Danp2 commented May 9, 2023

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

@Danp2 Danp2 removed the upstream issue with upstream webdriver label May 9, 2023
@Danp2 Danp2 closed this as completed May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants