XinYoung Posted March 27, 2019 Posted March 27, 2019 Hello all! The website I manipulate no longer supports IE. We've already lost a lot of functionality and I've been making workarounds, but this can't last much longer. I need to convert all the scripts to Chrome. I looked into the Webdriver Udf but can't understand exactly what I'm supposed to do. JSON? What? Chrome Webdriver? What what? Can someone break it down for me??? Like, "first download this .au3 file and put it in your 'include' folder, then change all IE functions to Chrome functions. The functions can conveniently be found here." (This is an optimistic idea of how easy this will be) Please please and thank you!
Danp2 Posted March 27, 2019 Posted March 27, 2019 It's really not that difficult to get started -- Download the Webdriver UDF from Github. Download the JSON and WinHTTP UDFs if you don't already have them Download the ChromeDriver from here Modify wd_demo.au3 to use Chrome instead of Firefox (see line near top defining the constant $_TestType) Adjust the demo code to execute by setting the appropriate entries in $aDemoSuite to True / False Run wd_demo.au3 Once you've got a better understanding of the demo code, you can start converting your existing script. Latest Webdriver UDF Release Webdriver Wiki FAQs
XinYoung Posted March 27, 2019 Author Posted March 27, 2019 Download the Webdriver UDF from Github. DONE Download the JSON and WinHTTP UDFs if you don't already have them DONE Download the ChromeDriver from here DONE Modify wd_demo.au3 to use Chrome instead of Firefox (see line near top defining the constant $_TestType) DONE Adjust the demo code to execute by setting the appropriate entries in $aDemoSuite to True / False I dont understand... Local $aDemoSuite[][2] = [["DemoTimeouts", False], _ ["DemoNavigation", False], _ ["DemoElements", True], _ ["DemoScript", False], _ ["DemoCookies", False], _ ["DemoAlerts", False], _ ["DemoFrames", False], _ ["DemoActions", False], _ ["DemoWindows", False]] Run wd_demo.au3 I'm missing the WinHttp.au3 file. Where can I get that?
Danp2 Posted March 27, 2019 Posted March 27, 2019 42 minutes ago, XinYoung said: I dont understand... Local $aDemoSuite[][2] = [["DemoTimeouts", False], _ ["DemoNavigation", False], _ ["DemoElements", True], _ ["DemoScript", False], _ ["DemoCookies", False], _ ["DemoAlerts", False], _ ["DemoFrames", False], _ ["DemoActions", False], _ ["DemoWindows", False]] These are separate "demo" routines, which you can turn on/off by changing the 2nd entry to True/False. In the posted example, only the DemoElements routine will execute when you run wd_demo. Change all of the values to True if you want the entire demo to run. 44 minutes ago, XinYoung said: I'm missing the WinHttp.au3 file. Where can I get that? This is the main file from the WinHTTP UDF. You indicated that you have already downloaded it. What did you do with the file you downloaded? Latest Webdriver UDF Release Webdriver Wiki FAQs
Nine Posted March 27, 2019 Posted March 27, 2019 Hi Xin, look in danp2 signature. There a reference to it. “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
XinYoung Posted March 27, 2019 Author Posted March 27, 2019 OK, I got the WinHttp.au3 file Now I'm getting warning: $SB_UTF8: possibly used before declaration. from line 233 in the wd_core file...
Nine Posted March 27, 2019 Posted March 27, 2019 You also need WinHttpConstants.au3 “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
XinYoung Posted March 27, 2019 Author Posted March 27, 2019 1 minute ago, Nine said: You also need WinHttpConstants.au3 i got that one too
Danp2 Posted March 27, 2019 Posted March 27, 2019 $SB_UTF8 comes from StringConstants.au3, which is included via Array.au3 (which is included at the top of wd_core.au3. Are you perhaps using an older version of Autoit? Latest Webdriver UDF Release Webdriver Wiki FAQs
XinYoung Posted March 27, 2019 Author Posted March 27, 2019 Im using 3.3.14.2 I don't have the privileges to update it on my system
Danp2 Posted March 27, 2019 Posted March 27, 2019 These constants were added to StringConstants.au3 back in 3.3.13.20, so they should be there. Perhaps you have an older version of StringConstants.au3 in your UDF directory and it's interfering with the default one. Latest Webdriver UDF Release Webdriver Wiki FAQs
XinYoung Posted March 27, 2019 Author Posted March 27, 2019 OK. My StringConstants appears to have been edited. Where can I download it??
Nine Posted March 27, 2019 Posted March 27, 2019 17 minutes ago, XinYoung said: Where can I download it?? You can't download it. Man you got to take control of the situation they have put you in. If they can decide that IE is not the right browser, it is not rightful that they do not allow you to download the right version of the tool they ask you to use. “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
Danp2 Posted March 27, 2019 Posted March 27, 2019 Go to https://www.autoitscript.com/site/autoit/downloads/ and download the self extracting archive. Latest Webdriver UDF Release Webdriver Wiki FAQs
junkew Posted March 31, 2019 Posted March 31, 2019 Potentially it could be easier to use UIA functions but also then you need to study some more. See FAQ 31 to get reference to how to click elements in chrome and other browsers. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
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