Danp2 Posted June 16, 2021 Author Share Posted June 16, 2021 17 minutes ago, Lion66 said: 1. Extend UDF with verify functions. At least the most common ones. Hi... new "helper" functions will be added as needed. The project is hosted on Github, so feel free to submit any PRs there. 😉 24 minutes ago, Lion66 said: Think about making a spy as the Au3Info and on mouse hover showing xpath (full and relative), css selector and other parameters that I have not thought about yet. There are already browser extensions that offer this, so I don't see any reason to "reinvent the wheel". Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Lion66 Posted June 16, 2021 Share Posted June 16, 2021 Thanks for your reply. I thought, it would be nice to have our spy, written on autoit. This would also be an additional example of using UDFs. Link to comment Share on other sites More sharing options...
mLipok Posted June 18, 2021 Share Posted June 18, 2021 (edited) in "wd_helper.au3" there is: Local Const $cRegKey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\' UDF read the value. When this vaule is set ?I'm wondering.... If I have the driver file name WebDriver_Chrome.exe or WebDriver_Firefox.exe or WebDriver_Edge.exe .... Should i search for different subkey (for such case) ? My mistake.  Edited June 18, 2021 by mLipok Signature beginning:* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *  My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"  , be   and    \\//_. Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
water Posted June 18, 2021 Share Posted June 18, 2021 Google is your friend https://docs.microsoft.com/en-us/windows/win32/shell/app-registration mLipok 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.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 PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki  Link to comment Share on other sites More sharing options...
nikink Posted June 21, 2021 Share Posted June 21, 2021 (edited) Hi all, Â I've been trying to get my head around how this works and have come across a strange issue whereby I can't clear an input field anymore. When I was doing some preliminary testing I found that _WD_SetElementValue($sSession, $sInputElement, "") worked to clear existing data. But now, it doesn't? Not sure if I was simply mistaken before (entirely possible) or if the latest Firefox broke the behaviour somehow? EIther way, my goal is to clear an input field so I can put another string into it. Func Google_Navigation($sURL = "https://www.google.com") Local $XPath. $sInputElement _WD_Navigate($sSession, $sURL) ;;;;;;;;;;;;;;;;;; MY CODE :::::::::::::::: $XPath = "/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div/div[2]/input" $sInputElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $XPath) ;should find the search input field ConsoleWrite("$sInputElement = " & $sInputElement & @CRLF) _WD_SetElementValue($sSession, $sInputElement, "stuff") MsgBox(0,"Check Google", "Input says 'Stuff'.") _WD_SetElementValue($sSession, $sInputElement, "") MsgBox(0,"Check Google", "Input should be blank...?") EndFunc Any help very appreciated. EDIT: D'Oh! _WD_ElementAction($sSession, $sInputElement, "Clear") works. Why did I have to find that just after posting for help? Edited June 21, 2021 by nikink Found the solution. I'm an idiot. Danp2 1 Link to comment Share on other sites More sharing options...
mLipok Posted June 21, 2021 Share Posted June 21, 2021 (edited) @Danp2 in wd_helper.au3 you are using @trancexx _Base64Decode() function. As for me It is ok that you use this function, but I start wondering if it will hit an issue in a future when somebody want to use both @trancexx functions I mean _Base64Encode() and _Base64Decode() for any other purpose. So I propose to change in wd_helper.au3 this function name from _Base64Decode() to __WD_Base64Decode() .. of course the author and link should stay unchanged. What you think about ? mLipok Edited June 21, 2021 by mLipok Danyfirex 1 Signature beginning:* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *  My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"  , be   and    \\//_. Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Danp2 Posted June 21, 2021 Author Share Posted June 21, 2021 @mLipokI can see where this could be an issue, but not sure how likely it would actually occur. Go ahead and submit a PR with the changes. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
gtats Posted June 21, 2021 Share Posted June 21, 2021 Hi. I'm trying to select one of the options of a drop-down item. The source of it, is: <div class="c2c"> <div class="left"> <span >Protocol</span> </div> <div class="right" id=""> <select name="port_frw_ptcl" id="optvar_port_frw_ptcl"> <option value="0">TCP</option> <option value="1">UDP</option> <option value="2">Both</option> </select> </div> </div> and its XPath and outerHTML: //*[@id="containercontent"]/div/div/div[7]/div[2]/div/span //*[@id="containercontent"]/div/div/div[7]/div[2]/div/div/span[1] //*[@id="containercontent"]/div/div/div[7]/div[2]/div/div/span[2] //*[@id="containercontent"]/div/div/div[7]/div[2]/div/div/span[3] Â <span class="jquery-selectbox-currentItem">TCP</span> <span class="jquery-selectbox-item value-0 item-0">TCP</span> <span class="jquery-selectbox-item value-1 item-1">UDP</span> <span class="jquery-selectbox-item value-2 item-2">Both</span> I tried _WD_ElementAction($sSession, _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']"), "value", "2") but i'm getting a "__WD_Post ==> Element interaction issue: {"value":{"error":"element not interactable","message":"element not interactable\n" message. What am i doing wrong? Â Link to comment Share on other sites More sharing options...
Danp2 Posted June 21, 2021 Author Share Posted June 21, 2021 @gtatsYou have to locate the element with _WDFindElement and then use the returned element as a parameter to _WD_ElementAction. An alternative would be to use _WD_ElementOptionSelect instead. gtats 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
gtats Posted June 21, 2021 Share Posted June 21, 2021 57 minutes ago, Danp2 said: @gtatsYou have to locate the element with _WDFindElement and then use the returned element as a parameter to _WD_ElementAction. An alternative would be to use _WD_ElementOptionSelect instead.  I tried $TD = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']/option", "", "True") _WD_ElementAction($sSession, $TD[2], "click") but the selected option doesn't change. What syntax should _WD_ElementOptionSelect have?   Link to comment Share on other sites More sharing options...
Danp2 Posted June 21, 2021 Author Share Posted June 21, 2021 26 minutes ago, gtats said: I tried $TD = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']/option", "", "True") _WD_ElementAction($sSession, $TD[2], "click") but the selected option doesn't change. Can you post the details from the Scite output panel? Make sure that you haven't changed the value of $_WD_DEBUG so that you get the most detailed output. The syntax for _WD_ElementOptionSelect is similar to what you posted above for _WD_FindElement, except that the selector should be for the exact option that you want selected and there's no ability for selecting multiple elements and that wouldn't have sense here. P.S. Search the forum and you should find some example code gtats 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
gtats Posted June 21, 2021 Share Posted June 21, 2021 59 minutes ago, Danp2 said: Can you post the details from the Scite output panel? Make sure that you haven't changed the value of $_WD_DEBUG so that you get the most detailed output. The syntax for _WD_ElementOptionSelect is similar to what you posted above for _WD_FindElement, except that the selector should be for the exact option that you want selected and there's no ability for selecting multiple elements and that wouldn't have sense here. P.S. Search the forum and you should find some example code   __WD_Post: URL=HTTP://127.0.0.1:9515/session/568cc156fcf3c5fe020d6eb5ba7ca9c3/elements; $sData={"using":"xpath","value":"//select[@id='optvar_port_frw_ptcl']/option"} __WD_Post: StatusCode=200; ResponseText={"value":[{"element-6066-11e4-a52e-4f735466cecf":"426f4cad-00b5-4891-afe7-9a8e5631dfde"},{"element-6... _WD_FindElement: {"value":[{"element-6066-11e4-a52e-4f735466cecf":"426f4cad-00b5-4891-afe7-9a8e5631dfde"},{"element-6066-11e4-a52e-4f735466cecf":"09890701-9a40-42c9-8665-85e36608eb07"},{"element-6066-11e4-a52e-4f735466cecf":"a2c46600-891a-40cb-b38c-5ca7f008dd37"}]} __WD_Post: URL=HTTP://127.0.0.1:9515/session/568cc156fcf3c5fe020d6eb5ba7ca9c3/element/a2c46600-891a-40cb-b38c-5ca7f008dd37/click; $sData={"id":"a2c46600-891a-40cb-b38c-5ca7f008dd37"} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"element not interactable","message":"element not interactable: Element is not cur... __WD_Post ==> Element interaction issue: {"value":{"error":"element not interactable","message":"element not interactable: Element is not currently visible and may not be manipulated\n  (Session info: MicrosoftEdge=91.0.864.54)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00007FF715915D02+4676866]\n\tOrdinal0 [0x00007FF7155BD6B7+1169079]\n\tOrdinal0 [0x00007FF7155C075E+1181534]\n\tOrdinal0 [0x00007FF7155F5763+1398627]\n\tOrdinal0 [0x00007FF7155F8BB8+1412024]\n\tOrdinal0 [0x00007FF7155EA3FA+1352698]\n\tOrdinal0 [0x00007FF71560F486+1504390]\n\tOrdinal0 [0x00007FF7155E96CD+1349325]\n\tOrdinal0 [0x00007FF71560F64C+1504844]\n\tOrdinal0 [0x00007FF7156212E0+1577696]\n\tOrdinal0 [0x00007FF71560F2FF+1503999]\n\tOrdinal0 [0x00007FF7155E80A1+1343649]\n\tOrdinal0 [0x00007FF7155E91CB+1348043]\n\tOrdinal0 [0x00007FF715690161+2031969]\n\tOrdinal0 [0x00007FF71565C77E+1820542]\n\tOrdinal0 [0x00007FF715833274+3748468]\n\tOrdinal0 [0x00007FF71565D14E+1823054]\n\tOrdinal0 [0x00007FF7159288C4+4753604]\n\tOrdinal0 [0x00007FF7159281C4+4751812]\n\tOrdinal0 [0x00007FF71592800A+4751370]\n\tOrdinal0 [0x00007FF715900028+4587560]\n\tBaseThreadInitThunk [0x00007FFC43806FD4+20]\n\tRtlUserThreadStart [0x00007FFC4407CEC1+33]\n"}} _WD_ElementAction: {"value":{"error":"element not interactable","message":"element not interactable: Element is not cur... _WD_ElementAction ==> Element interaction issue: {"value":{"error":"element not interactable","message":"element not interactable: Element is not currently visible and may not be manipulated\n  (Session info: MicrosoftEdge=91.0.864.54)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00007FF715915D02+4676866]\n\tOrdinal0 [0x00007FF7155BD6B7+1169079]\n\tOrdinal0 [0x00007FF7155C075E+1181534]\n\tOrdinal0 [0x00007FF7155F5763+1398627]\n\tOrdinal0 [0x00007FF7155F8BB8+1412024]\n\tOrdinal0 [0x00007FF7155EA3FA+1352698]\n\tOrdinal0 [0x00007FF71560F486+1504390]\n\tOrdinal0 [0x00007FF7155E96CD+1349325]\n\tOrdinal0 [0x00007FF71560F64C+1504844]\n\tOrdinal0 [0x00007FF7156212E0+1577696]\n\tOrdinal0 [0x00007FF71560F2FF+1503999]\n\tOrdinal0 [0x00007FF7155E80A1+1343649]\n\tOrdinal0 [0x00007FF7155E91CB+1348043]\n\tOrdinal0 [0x00007FF715690161+2031969]\n\tOrdinal0 [0x00007FF71565C77E+1820542]\n\tOrdinal0 [0x00007FF715833274+3748468]\n\tOrdinal0 [0x00007FF71565D14E+1823054]\n\tOrdinal0 [0x00007FF7159288C4+4753604]\n\tOrdinal0 [0x00007FF7159281C4+4751812]\n\tOrdinal0 [0x00007FF71592800A+4751370]\n\tOrdinal0 [0x00007FF715900028+4587560]\n\tBaseThreadInitThunk [0x00007FFC43806FD4+20]\n\tRtlUserThreadStart [0x00007FFC4407CEC1+33]\n"}}    Link to comment Share on other sites More sharing options...
Danp2 Posted June 22, 2021 Author Share Posted June 22, 2021 @gtatsSo it found the elements, but wasn't able to click on the desired one. This could be because it isn't visible. Have you tried triggering the dropdown menu beforehand? gtats 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
gtats Posted June 22, 2021 Share Posted June 22, 2021 5 hours ago, Danp2 said: @gtatsSo it found the elements, but wasn't able to click on the desired one. This could be because it isn't visible. Have you tried triggering the dropdown menu beforehand? No i haven't. Which method should i use? Link to comment Share on other sites More sharing options...
Danp2 Posted June 22, 2021 Author Share Posted June 22, 2021 I would first try to click on the main Select element using _WD_FindElement and _WD_ElementAction. If that doesn't work, then we will need to know more details about the website to help. gtats 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
gtats Posted June 22, 2021 Share Posted June 22, 2021 (edited) 8 hours ago, Danp2 said: I would first try to click on the main Select element using _WD_FindElement and _WD_ElementAction. If that doesn't work, then we will need to know more details about the website to help.  I hope this isn't becoming too tedious and boring. The web page in question is the webUI of a router. After your suggestion i tried the following. _WD_ElementAction($sSession, _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']"), "click") $TD = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']/option", "", "True") _WD_ElementAction($sSession, $TD[2], "click") Still no change and the desired option is not being selected. After reading some older posts i also tried this. $A = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']") _WD_HighlightElement($sSession, $A, 1) _WD_ElementAction($sSession, _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']"), "click") $TD = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']/option", "", "True") _WD_ElementAction($sSession, $TD[2], "click") Then a second (?) element appeared and the desired option was selected.                  I guess problem solved but i'm somehow confused. What's the difference between the 2 of them? XPath 1st: //*[@id="containercontent"]/div/div/div[7]/div[2]/div/span 2nd: //*[@id="optvar_port_frw_ptcl"] outerHTML 1st: <span class="jquery-selectbox-currentItem">TCP</span> <span class="jquery-selectbox-item value-0 item-0">TCP</span> <span class="jquery-selectbox-item value-1 item-1">UDP</span> <span class="jquery-selectbox-item value-2 item-2">Both</span> 2nd: <div class="jquery-selectbox jquery-custom-selectboxes-replaced"><div class="jquery-selectbox-list jquery-custom-selectboxes-replaced-list" style="display: none;"><span class="jquery-selectbox-item value-0 item-0">TCP</span><span class="jquery-selectbox-item value-1 item-1">UDP</span><span class="jquery-selectbox-item value-2 item-2">Both</span></div><span class="jquery-selectbox-currentItem">TCP</span></div>  Edited June 22, 2021 by gtats Link to comment Share on other sites More sharing options...
Danp2 Posted June 22, 2021 Author Share Posted June 22, 2021 9 minutes ago, gtats said: _WD_ElementAction($sSession, _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='optvar_port_frw_ptcl']"), "click") I would always break this into two separate commands so that you can detect errors, etc. Hard to say why it didn't work since you didn't include the debugging output. 13 minutes ago, gtats said: Then a second (?) element appeared and the desired option was selected. Some of the Javascript libraries use hidden elements that aren't the one you should be targeting. Based on your description above, it sounds like you were targeting the hidden element instead of the visible one. This would explain why you received the element not interactable message earlier. gtats 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
gtats Posted June 22, 2021 Share Posted June 22, 2021 Thank you very much for the help. Javascript isn't my strong suit.  Quote Hard to say why it didn't work since you didn't include the debugging output.  __WD_Post: URL=HTTP://127.0.0.1:9515/session/05b4c54393af0842a34ec753619796f0/element; $sData={"using":"xpath","value":"//select[@id='optvar_port_frw_ptcl']"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"a6095ba6-f92b-4e4e-84e8-1c2c8c714ba5"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"a6095ba6-f92b-4e4e-84e8-1c2c8c714ba5"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/05b4c54393af0842a34ec753619796f0/element/a6095ba6-f92b-4e4e-84e8-1c2c8c714ba5/click; $sData={"id":"a6095ba6-f92b-4e4e-84e8-1c2c8c714ba5"} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"element not interactable","message":"element not interactable\n  (Session info: M... __WD_Post ==> Element interaction issue: {"value":{"error":"element not interactable","message":"element not interactable\n  (Session info: MicrosoftEdge=91.0.864.54)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00007FF637225D02+4676866]\n\tOrdinal0 [0x00007FF636ECD543+1168707]\n\tOrdinal0 [0x00007FF636F05CCA+1400010]\n\tOrdinal0 [0x00007FF636EF9969+1349993]\n\tOrdinal0 [0x00007FF636F1F486+1504390]\n\tOrdinal0 [0x00007FF636EF96CD+1349325]\n\tOrdinal0 [0x00007FF636F1F64C+1504844]\n\tOrdinal0 [0x00007FF636F312E0+1577696]\n\tOrdinal0 [0x00007FF636F1F2FF+1503999]\n\tOrdinal0 [0x00007FF636EF80A1+1343649]\n\tOrdinal0 [0x00007FF636EF91CB+1348043]\n\tOrdinal0 [0x00007FF636FA0161+2031969]\n\tOrdinal0 [0x00007FF636F6C77E+1820542]\n\tOrdinal0 [0x00007FF637143274+3748468]\n\tOrdinal0 [0x00007FF636F6D14E+1823054]\n\tOrdinal0 [0x00007FF6372388C4+4753604]\n\tOrdinal0 [0x00007FF6372381C4+4751812]\n\tOrdinal0 [0x00007FF63723800A+4751370]\n\tOrdinal0 [0x00007FF637210028+4587560]\n\tBaseThreadInitThunk [0x00007FFCC4866FD4+20]\n\tRtlUserThreadStart [0x00007FFCC583CEC1+33]\n"}} _WD_ElementAction: {"value":{"error":"element not interactable","message":"element not interactable\n  (Session info: M... _WD_ElementAction ==> Element interaction issue: {"value":{"error":"element not interactable","message":"element not interactable\n  (Session info: MicrosoftEdge=91.0.864.54)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00007FF637225D02+4676866]\n\tOrdinal0 [0x00007FF636ECD543+1168707]\n\tOrdinal0 [0x00007FF636F05CCA+1400010]\n\tOrdinal0 [0x00007FF636EF9969+1349993]\n\tOrdinal0 [0x00007FF636F1F486+1504390]\n\tOrdinal0 [0x00007FF636EF96CD+1349325]\n\tOrdinal0 [0x00007FF636F1F64C+1504844]\n\tOrdinal0 [0x00007FF636F312E0+1577696]\n\tOrdinal0 [0x00007FF636F1F2FF+1503999]\n\tOrdinal0 [0x00007FF636EF80A1+1343649]\n\tOrdinal0 [0x00007FF636EF91CB+1348043]\n\tOrdinal0 [0x00007FF636FA0161+2031969]\n\tOrdinal0 [0x00007FF636F6C77E+1820542]\n\tOrdinal0 [0x00007FF637143274+3748468]\n\tOrdinal0 [0x00007FF636F6D14E+1823054]\n\tOrdinal0 [0x00007FF6372388C4+4753604]\n\tOrdinal0 [0x00007FF6372381C4+4751812]\n\tOrdinal0 [0x00007FF63723800A+4751370]\n\tOrdinal0 [0x00007FF637210028+4587560]\n\tBaseThreadInitThunk [0x00007FFCC4866FD4+20]\n\tRtlUserThreadStart [0x00007FFCC583CEC1+33]\n"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/05b4c54393af0842a34ec753619796f0/elements; $sData={"using":"xpath","value":"//select[@id='optvar_port_frw_ptcl']/option"} __WD_Post: StatusCode=200; ResponseText={"value":[{"element-6066-11e4-a52e-4f735466cecf":"ec89e31e-203d-4c18-ad9a-9586fd685ed8"},{"element-6... _WD_FindElement: {"value":[{"element-6066-11e4-a52e-4f735466cecf":"ec89e31e-203d-4c18-ad9a-9586fd685ed8"},{"element-6066-11e4-a52e-4f735466cecf":"53eb6119-b46e-403b-b678-a9c0944d7431"},{"element-6066-11e4-a52e-4f735466cecf":"9b966ff6-43d9-477f-b858-69f96e1f2233"}]} __WD_Post: URL=HTTP://127.0.0.1:9515/session/05b4c54393af0842a34ec753619796f0/element/9b966ff6-43d9-477f-b858-69f96e1f2233/click; $sData={"id":"9b966ff6-43d9-477f-b858-69f96e1f2233"} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"element not interactable","message":"element not interactable: Element is not cur... __WD_Post ==> Element interaction issue: {"value":{"error":"element not interactable","message":"element not interactable: Element is not currently visible and may not be manipulated\n  (Session info: MicrosoftEdge=91.0.864.54)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00007FF637225D02+4676866]\n\tOrdinal0 [0x00007FF636ECD6B7+1169079]\n\tOrdinal0 [0x00007FF636ED075E+1181534]\n\tOrdinal0 [0x00007FF636F05763+1398627]\n\tOrdinal0 [0x00007FF636F08BB8+1412024]\n\tOrdinal0 [0x00007FF636EFA3FA+1352698]\n\tOrdinal0 [0x00007FF636F1F486+1504390]\n\tOrdinal0 [0x00007FF636EF96CD+1349325]\n\tOrdinal0 [0x00007FF636F1F64C+1504844]\n\tOrdinal0 [0x00007FF636F312E0+1577696]\n\tOrdinal0 [0x00007FF636F1F2FF+1503999]\n\tOrdinal0 [0x00007FF636EF80A1+1343649]\n\tOrdinal0 [0x00007FF636EF91CB+1348043]\n\tOrdinal0 [0x00007FF636FA0161+2031969]\n\tOrdinal0 [0x00007FF636F6C77E+1820542]\n\tOrdinal0 [0x00007FF637143274+3748468]\n\tOrdinal0 [0x00007FF636F6D14E+1823054]\n\tOrdinal0 [0x00007FF6372388C4+4753604]\n\tOrdinal0 [0x00007FF6372381C4+4751812]\n\tOrdinal0 [0x00007FF63723800A+4751370]\n\tOrdinal0 [0x00007FF637210028+4587560]\n\tBaseThreadInitThunk [0x00007FFCC4866FD4+20]\n\tRtlUserThreadStart [0x00007FFCC583CEC1+33]\n"}} _WD_ElementAction: {"value":{"error":"element not interactable","message":"element not interactable: Element is not cur... _WD_ElementAction ==> Element interaction issue: {"value":{"error":"element not interactable","message":"element not interactable: Element is not currently visible and may not be manipulated\n  (Session info: MicrosoftEdge=91.0.864.54)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00007FF637225D02+4676866]\n\tOrdinal0 [0x00007FF636ECD6B7+1169079]\n\tOrdinal0 [0x00007FF636ED075E+1181534]\n\tOrdinal0 [0x00007FF636F05763+1398627]\n\tOrdinal0 [0x00007FF636F08BB8+1412024]\n\tOrdinal0 [0x00007FF636EFA3FA+1352698]\n\tOrdinal0 [0x00007FF636F1F486+1504390]\n\tOrdinal0 [0x00007FF636EF96CD+1349325]\n\tOrdinal0 [0x00007FF636F1F64C+1504844]\n\tOrdinal0 [0x00007FF636F312E0+1577696]\n\tOrdinal0 [0x00007FF636F1F2FF+1503999]\n\tOrdinal0 [0x00007FF636EF80A1+1343649]\n\tOrdinal0 [0x00007FF636EF91CB+1348043]\n\tOrdinal0 [0x00007FF636FA0161+2031969]\n\tOrdinal0 [0x00007FF636F6C77E+1820542]\n\tOrdinal0 [0x00007FF637143274+3748468]\n\tOrdinal0 [0x00007FF636F6D14E+1823054]\n\tOrdinal0 [0x00007FF6372388C4+4753604]\n\tOrdinal0 [0x00007FF6372381C4+4751812]\n\tOrdinal0 [0x00007FF63723800A+4751370]\n\tOrdinal0 [0x00007FF637210028+4587560]\n\tBaseThreadInitThunk [0x00007FFCC4866FD4+20]\n\tRtlUserThreadStart [0x00007FFCC583CEC1+33]\n"}}  Link to comment Share on other sites More sharing options...
Danp2 Posted June 22, 2021 Author Share Posted June 22, 2021 This is the same error as before. Also, the HTML you posted earlier doesn't appear to belong to a standard Select element. Can you save the entire webpage to a file and post it here? The solution is probably going to require making a jQuery call with _WD_ExecuteScript. gtats 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
gtats Posted June 22, 2021 Share Posted June 22, 2021 (edited) 1 hour ago, Danp2 said: This is the same error as before. Also, the HTML you posted earlier doesn't appear to belong to a standard Select element. Can you save the entire webpage to a file and post it here? The solution is probably going to require making a jQuery call with _WD_ExecuteScript. Â Â source.txt Edited June 22, 2021 by gtats Link to comment Share on other sites More sharing options...
Recommended Posts