rundak Posted 3 hours ago Posted 3 hours ago Hello, I need some help with React-select dropdown list? How to interact with it? All option are hidden. Example: How to choose "Silver" from single value list on this page https://react-select.com/home using WebDriver (may be WD_ExecuteScript)? I can only click on this using code, no idea how to choose 'Silver' without clicking. Local $website_link = 'https://react-select.com/home' $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, $website_link) $list = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='react-select-3-input']") _WD_ElementAction($sSession, $list, 'click') _WD_ElementAction($sSession, $list, 'value', 'Silver') doesn't work Any idea how to do it in the easiest direct way? May be there is possibility to choose it somehow with WD_ExecuteScript? I have already tried some instruction but no success. _WD_ExecuteScript($sSession, "arguments[0].scrollIntoView();", "//input[@aria-activedescendant='react-select-3-option-9']") Thank you for your help.
Nine Posted 2 hours ago Posted 2 hours ago When you post code, please use the method shown in the link. Here one way : $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='react-select-3-input']") _WD_ElementAction($sSession, $sElement, 'value', "Silver") Local $sAction = '{"actions":[{"type":"key","id":"keyboard_1","actions":[{"type":"keyDown","value":"\uE007"},{"type":"keyUp","value":"\uE007"}]}]}' _WD_Action($sSession, "actions", $sAction) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
rundak Posted 19 minutes ago Author Posted 19 minutes ago (edited) Sorry. It works and it is enough for me. Thank you for your help. Edited 19 minutes ago by rundak
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