Hermes Posted April 5, 2021 Share Posted April 5, 2021 Hi, i have a site that has shadow root in it, and i am trying to find an element that has a specific attribute in it which is: <test-accordion accordion-list="[{"name":"test","label":"testname"}]"></test-accordion> When I tried: _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "test-accordion[accordion-list="[{'name':'test','label':'testname'}]"]", $test2) it's returning this error message for that specific line: _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "test-accordion[accordion-list="[{'name':'test','label':'testname'}]"]", $test2) ==> Unable to parse line.: Appreciate any help that I can get, or if there are any alternative approach. Link to comment Share on other sites More sharing options...
TheXman Posted April 5, 2021 Share Posted April 5, 2021 (edited) Compare the line below to your original line to see the differences. Then read the Help file's section on strings to understand why the line below is able to be parsed correctly. _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "test-accordion[accordion-list=""[{'name':'test','label':'testname'}]""]", $test2) Edited April 5, 2021 by TheXman Hermes 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Hermes Posted April 6, 2021 Author Share Posted April 6, 2021 (edited) Thanks, it all makes sense now. I just modified the line (see below), and it now worked! _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "test-accordion[accordion-list='[""name"":'test"",""label"":""testname""}]']", $test2) Edited April 6, 2021 by Hermes TheXman 1 Link to comment Share on other sites More sharing options...
TheXman Posted April 6, 2021 Share Posted April 6, 2021 11 hours ago, Hermes said: Thanks, it all makes sense now. You're welcome. I'm glad that you were able to figured it out. Knowledge that you figure out on your own is usually retained longer than when you are just provided the answer. CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Hermes Posted April 14, 2021 Author Share Posted April 14, 2021 Totally agree! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now