redrum Posted February 10, 2023 Share Posted February 10, 2023 Attempting to get any example script running so I have a Firefox script structure working that I can start with for my application. I've worked on both demo and GDPR and successfully gotten the scripts to execute. But now, both are giving the same error when the script is run. The demo menu comes up correctly, but any selected option gives an error when trying to open a session, Exception 10, GDPR does the same. I would just like some general direction here to solve this issue. This is my first use of WebDriver, I have done many scripts in the past with the prior IE UDF. Doug GDPR latest.au3 Link to comment Share on other sites More sharing options...
Developers Jos Posted February 10, 2023 Developers Share Posted February 10, 2023 Moved to the appropriate AutoIt General Help and Support forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Danp2 Posted February 10, 2023 Share Posted February 10, 2023 @redrumLet's stick with wd_demo. First step would be to enable full debugging via the GUI. Then click the Run Demo button to execute the selected demo. Finally, copy the full output from the console and post it here using the same method as when you post code to the forum. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
redrum Posted February 10, 2023 Author Share Posted February 10, 2023 Thanks for the help! I have a different error now (for some reason) so here is the results of the full debug run: I still have the original issue on the GDPR script, I will send the full debug run for that as well. Doug Debug Console.txt Link to comment Share on other sites More sharing options...
redrum Posted February 10, 2023 Author Share Posted February 10, 2023 This is the console text from the debug of GDPR, giving the exception 10 error. GDPR debug console.txt Link to comment Share on other sites More sharing options...
Danp2 Posted February 10, 2023 Share Posted February 10, 2023 Quote _WD_Startup: WinHTTP: 1.6.4.1 (Download latest source at <https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3>) You should address this when you have a moment. Quote __WD_Post ==> Webdriver Exception [10] : HTTP status = 500 ResponseText={"value":{"error":"session not created","message":"Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line","stacktrace":""}} This should be self explanatory. You can try switching to the 32 bit version of geckodriver, which could solve this. Otherwise, you will need to provide the path to the executable in your capabilities string. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
redrum Posted February 11, 2023 Author Share Posted February 11, 2023 I updated to WinHttp 1.6.4.2. I also updated to 32 bit version of geckodriver - this did not solve the Exception 10 issue. I am now trying to "provide path to the executable in capabilities string" but have not been able to figure out how/where to do this. I've read the "Webdriver>Capabilities" description, but have not been able to make any progress. Just need a little more guidance here! Thanks, Doug Debug.txt Link to comment Share on other sites More sharing options...
water Posted February 11, 2023 Share Posted February 11, 2023 Please have a look at the wiki, FAQ for WebDriver #6 Danp2 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...
redrum Posted February 14, 2023 Author Share Posted February 14, 2023 Demo is bringing up the GUI menu, but when executed I still have an error. I believe I have the driver (geckodriver 32B) and the location of the Firefox.exe binary file added correctly. I had a lot of trouble finding the Firefox.exe location and had to uninstall and reinstall Firefox from the Microsoft Store. The file location seems weird, but I think it is correct as I got it from the Firefox help menu after installation. I think my issue is that I don't have the Firefox required capabilities defined correctly, have not been able to find something that works. So, would like some additional pointer(s) here please. Doug Console debug text 021323.txt wd_demo.au3 Link to comment Share on other sites More sharing options...
Danp2 Posted February 14, 2023 Share Posted February 14, 2023 You actually want to read FAQ #4 instead of FAQ #6. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
redrum Posted February 14, 2023 Author Share Posted February 14, 2023 Yes, I realized that after the previous response. I have tried to use both methods for Firefox from Q4. The first method is presently included in the demo script that I attached. The second method did not solve the issue either (it is still in the script but commented out). I have searched addition info on Firefox capabilities, some of which I don't understand, but not making progress on this. Link to comment Share on other sites More sharing options...
Danp2 Posted February 14, 2023 Share Posted February 14, 2023 32 minutes ago, redrum said: The first method is presently included in the demo script that I attached. It's present, but it doesn't get used. That's because the actual capabilities are calculated in this line -- ; Execute browser setup routine for user's browser selection Local $sCapabilities = Call($aBrowsers[_GUICtrlComboBox_GetCurSel($idBrowsers)][1], $bHeadless) This calls the setup routine (SetupGecko for Firefox) and constructs the capabilities string using the _WD_Capabilites functions. You should either -- Adjust the code in SetupGecko to include the desired options Override the value of $sCapabilities *after* the above code is run Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
redrum Posted February 14, 2023 Author Share Posted February 14, 2023 Thanks! I now have the demo running, so will work to make progress on my script application. Link to comment Share on other sites More sharing options...
redrum Posted February 19, 2023 Author Share Posted February 19, 2023 Hello again, This must be something simple but I can't get past this. I can click on the Sign In link and bring up the sign in form (UN or email), but cannot figure out how to enter data into the element for "Username or email". Looking at the debug, I see that the element is not selected or displayed. This may be the issue, but I don't know how to get the element selected, so could use some guidance here. Thanks ZACKS dev tsting.au3 console 0219.txt Link to comment Share on other sites More sharing options...
Danp2 Posted February 19, 2023 Share Posted February 19, 2023 You can try using _WD_SetElementValue with the $_WD_OPTION_Advanced option. That site uses jQuery, so you can also take advantage of that with _WD_ExecuteScript. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
redrum Posted February 24, 2023 Author Share Posted February 24, 2023 Making slow progress - Seem to be stuck on 2 issues: I'm using 2 browser windows with one session (windows, not tabs). From forum research, I found some code with this statement: _WD_Attach($sSession, 'Switch', '{"handle":"' & $Hndlzacks & '"}') , and have been using it with some success. Where is the definition of this type of statement found? I have been using WebDriver UDF Library extensively, but _WD_Attach in this document does not show these types of options (switch). This is just an example - I cannot find, in general, the definition of options on many of the functions defined in WebDriver UDF library document. The W3C spec has been some help, but does not seem to directly relate to the WebDriver UDF functions. I'm assuming that the UDF commands call on these HTTP Methods. Can the HTTP Methods be used directly in a WebDriver UDF script? I have set: $_WD_DEBUG = $_WD_DEBUG_Info, and it has been logging to the console up until today, now no console comes up. I updated to the latest WebDriver UDF today, but don't expect this is the issue. I went back to a couple earlier versions of my script, and still debug did not appear on the console. Thanks for any direction you can provide here. Link to comment Share on other sites More sharing options...
Danp2 Posted February 24, 2023 Share Posted February 24, 2023 28 minutes ago, redrum said: _WD_Attach($sSession, 'Switch', '{"handle":"' & $Hndlzacks & '"}') Unsure where you came up with that, but it looks more like the format for _WD_Window, not _WD_Attach. There are examples of the correct usage for _WD_Attach in wd_demo.au3. Quote I cannot find, in general, the definition of options on many of the functions defined in WebDriver UDF library document. Not sure that I understand the problem. Have you tried using the help file that is distributed with the UDF? You also have the source code to review so that you can better understand what is occurring "under the hood". Quote The W3C spec has been some help, but does not seem to directly relate to the WebDriver UDF functions. I'm assuming that the UDF commands call on these HTTP Methods. Can the HTTP Methods be used directly in a WebDriver UDF script? If you review the source code, you will find that each function has an associated header. For example, the following is from _WD_Window -- ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WD_Window ; Description ...: Perform interactions related to the current window. ; Syntax ........: _WD_Window($sSession, $sCommand[, $sOption = Default]) ; Parameters ....: $sSession - Session ID from _WD_CreateSession ; $sCommand - One of the following actions: ; | ; |CLOSE - Close current tab ; |FRAME - Switch to frame ; |FULLSCREEN - Set window to fullscreen ; |HANDLES - Get all window handles ; |MAXIMIZE - Maximize window ; |MINIMIZE - Minimize window ; |NEW - Create a new window ; |PARENT - Switch to parent frame ; |PRINT - Generate PDF representation of the paginated document ; |RECT - Get or set the window's size & position ; |SCREENSHOT - Take screenshot of window ; |SWITCH - Switch to designated tab ; |WINDOW - Get or set the current window ; $sOption - [optional] a string value. Default is "" ; Return values .: Success - Return value from web driver (could be an empty string). ; Failure - "" (empty string) and sets @error to one of the following values: ; - $_WD_ERROR_Exception ; - $_WD_ERROR_InvalidDataType ; Author ........: Danp2 ; Modified ......: ; Remarks .......: ; Related .......: _WD_LastHTTPResult ; Link ..........: https://www.w3.org/TR/webdriver/#contexts ; Example .......: No ; =============================================================================================================================== Notice the link near the bottom? This gives you a reference to the associated W3C specs. Unsure what "http methods" you are referring to. Please elaborate. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
redrum Posted February 24, 2023 Author Share Posted February 24, 2023 Thanks, that helps 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