Jump to content

ElementAction and ElementOptionSelect alternatives


Recommended Posts

Hi, I have the following script: 

Local $oTest = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, ".create-page")
    Local $oTest2 = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "#main", $oTest)
    Local $oTest3 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "div.select_container", $oTest2)
    Local $oTest4 = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByTagName, "select-option", $oTest3)
    Local $oTest5 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "span.option-primary", $oTest4)
    $testresult = _WD_ElementAction($sSession, $oTest5, 'click')

And i am getting the below error msg when trying to click $otest5

_WD_ElementAction: {"value":{"error":"element not interactable","message":"element not interactable\n

And i realized that I cant use ElementAction/ElementOptionSelect  since span tag is not a pointer/keyboard interactable.

I've thought of using ExecuteScript as an option but i am not too sure on how i can use it, it doesn't work like this:

_WD_ExecuteScript($sSession, "arguments[0].click();", $oTest5)

 

Link to comment
Share on other sites

1 hour ago, Hermes said:

span tag is not a pointer/keyboard interactable.

Pretty sure that you can at least click on a span element

Hard to offer any advice without more details. I see that you  are still trying to access the shadow root. Does the above code run without any errors (check Scite output panel)?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...