Jump to content

Using _WD_ElementSelectAction to select an item from dropdown


Recommended Posts

Hi 

 

I'm trying to set a dropdown using the below. Currently I get an error as the msgbox pops up 

;Select item from dropdown
        $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '//*[@id="requestedValueSelect"]')
         _WD_ElementSelectAction($sSession, $sElement, 'Dropdown Item 1')
            if @error then
               Msgbox(64, "", "Error selecting dropdown", 2)
            EndIf

 

Scite output is 

__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"e3f9ac38-7d3e-4ea8-a7dc-15e72243277c"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"e3f9ac38-7d3e-4ea8-a7dc-15e72243277c"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/14bfb000ce938669841187d8fcd66da9/element/e3f9ac38-7d3e-4ea8-a7dc-15e72243277c/click; $sData={"id":"e3f9ac38-7d3e-4ea8-a7dc-15e72243277c"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ElementAction: {"value":null}...
__WD_Post: URL=HTTP://127.0.0.1:9515/session/14bfb000ce938669841187d8fcd66da9/element; $sData={"using":"xpath","value":"//*[@id=\"RequestedIds\"]"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"acc951a7-ee88-44ea-8632-cd65ff34ed6b"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"acc951a7-ee88-44ea-8632-cd65ff34ed6b"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/14bfb000ce938669841187d8fcd66da9/element/acc951a7-ee88-44ea-8632-cd65ff34ed6b/value; $sData={"id":"acc951a7-ee88-44ea-8632-cd65ff34ed6b", "text":"RIX804-0683959"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ElementAction: {"value":null}...
__WD_Post: URL=HTTP://127.0.0.1:9515/session/14bfb000ce938669841187d8fcd66da9/element; $sData={"using":"xpath","value":"//*[@id=\"requestedValueSelect\"]"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"01ef14bb-53c1-4c20-9abd-ab94ee6191ca"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"01ef14bb-53c1-4c20-9abd-ab94ee6191ca"}}
__WD_Get: URL=HTTP://127.0.0.1:9515/session/14bfb000ce938669841187d8fcd66da9/element/01ef14bb-53c1-4c20-9abd-ab94ee6191ca/property/nodeName
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"SELECT"}...
_WD_ElementAction: {"value":"SELECT"}...
_WD_ElementSelectAction ==> Invalid data type: (Value|Options) $sCommand=>Dropdown Item 1

Due to the scite output it's saying invalid date type? 

Link to post
Share on other sites

You could have a look at my example script in this thread:

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...