CaptainBeardsEyesBeard Posted February 22, 2021 Share Posted February 22, 2021 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 comment Share on other sites More sharing options...
water Posted February 22, 2021 Share Posted February 22, 2021 You could have a look at my example script in this thread: My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted February 22, 2021 Share Posted February 22, 2021 1 hour ago, CaptainBeardsEyesBeard said: Due to the scite output it's saying invalid date type? Correct. The 3rd parameter for _WD_ElementSelectAction is $sCommand, and it accepts two commands: Value and Options. The command you're looking for is _WD_ElementOptionSelect. Latest Webdriver UDF Release Webdriver Wiki FAQs 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