Danp2 Posted April 11, 2019 Author Share Posted April 11, 2019 @mihelson83 There's a function called _WD_NewTab. Take a look at how it's used here or in wd_demo.au3. mihelson83 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Letraindusoir Posted April 22, 2019 Share Posted April 22, 2019 excuse me, Where is the location of the chrome browser defined? If my chrome browser is not in the default installation location【C:\ Program Files (x86)\ Google\ Chrome\ Application\ 71.0.3578.98\ chrome.exe】, how should I specify the specific path to "chrome.exe" in my code? Link to comment Share on other sites More sharing options...
Danp2 Posted April 22, 2019 Author Share Posted April 22, 2019 @Letraindusoir This has been previously discussed. See search results here. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Letraindusoir Posted April 23, 2019 Share Posted April 23, 2019 19 hours ago, Danp2 said: @Letraindusoir This has been previously discussed. See search results here. Thanks a lot! Link to comment Share on other sites More sharing options...
BlackSnoww Posted April 27, 2019 Share Posted April 27, 2019 @Danp2 Mind me asking where did u get that webdriver.au3? i cant find it on the attached link in Github Link to comment Share on other sites More sharing options...
Danp2 Posted April 27, 2019 Author Share Posted April 27, 2019 @BlackSnoww Look in my signature. Click the "Latest version" link. Download the zip file and extract it. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
BlackSnoww Posted April 28, 2019 Share Posted April 28, 2019 (edited) @Danp2 ok i got mine running thanks. before i start digging deeper, I would like to ask if will this works if the chrome was launch by the user and not by the script ? Edited April 28, 2019 by BlackSnoww Link to comment Share on other sites More sharing options...
Danp2 Posted April 28, 2019 Author Share Posted April 28, 2019 @BlackSnoww Unfortunately, there isn't a way to attach to an previously launched Chrome instance. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
BlackSnoww Posted April 28, 2019 Share Posted April 28, 2019 Ok thanks Link to comment Share on other sites More sharing options...
Letraindusoir Posted April 29, 2019 Share Posted April 29, 2019 On 4/23/2019 at 3:10 AM, Danp2 said: @Letraindusoir This has been previously discussed. See search results here. Much Thanks for your hard work.... Spoiler Link to comment Share on other sites More sharing options...
Letraindusoir Posted April 30, 2019 Share Posted April 30, 2019 On 4/23/2019 at 3:10 AM, Danp2 said: @Letraindusoir This has been previously discussed. See search results here. I was busy with some other things last week and put the matter on hold for the time being.Today I tested the code, but it didn't work. The code is as follows: #include "wd_core.au3" Local $sDesiredCapabilities $_WD_DEBUG = False SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.88countryclub.co.kr/") $hwnd = WinWaitActive("88") WinSetState($hwnd, "", @SW_MAXIMIZE) Sleep(1000) ControlSend($hwnd, "", "", "^f") Func SetupChrome() _WD_Option('Driver', 'S:\Web_Driver\chromedriver.exe') ;_WD_Option('binary_location', 'S:\Browsers\Google\Chrome68\chrome.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path=' & @ScriptDir & '\chrome.log') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true,"binary_location":"S:\Browsers\Google\Chrome68\chrome.exe"}}}}' EndFunc I put the path of "chrome.exe" in two different locations,but neither succeeded in opening the browser.I still don't know what to do. Link to comment Share on other sites More sharing options...
Letraindusoir Posted April 30, 2019 Share Posted April 30, 2019 In addition,in a VBA forum I've seen selenium encapsulated as a "Component Object Model" component , and if that's the case, you can call the webdriver object directly.I don't know if AU3 has any exploration in this respect. Spoiler Link to comment Share on other sites More sharing options...
Letraindusoir Posted April 30, 2019 Share Posted April 30, 2019 40 minutes ago, Letraindusoir said: I put the path of "chrome.exe" in two different locations..... After several tests, I solved the problem myself. It should be inserted into "$sDesiredCapabilities", and in addition, the string must be escaped, that is,"\" need to be written as "\\". Link to comment Share on other sites More sharing options...
Letraindusoir Posted April 30, 2019 Share Posted April 30, 2019 Two more problems were found during today's testing of the code: 1, using a Firefox browser test, each time open a browser would be created a new browser process instance: how to control it to open in the new Tab? 2, Test with a Chrome browser, there are more problems: (1), if there is no existing Chrome browser, it can open the URL; If a Chrome browser process already exists, it would open a new TAB, and show in the address bar " Data:," but can't open the site (2), Chrome browser always prompts: Chrome is being controlled by automatic test software. It is said that can add the option "disable-infobars" to solve this problem, but do not know how to add. Link to comment Share on other sites More sharing options...
Danp2 Posted April 30, 2019 Author Share Posted April 30, 2019 2 hours ago, Letraindusoir said: using a Firefox browser test, each time open a browser would be created a new browser process instance: how to control it to open in the new Tab? Sorry, but it isn't clear exactly what you're attempting to do. When describing an issue, please post code showing what you have tried. As far as attaching to an existing FireFox browser, try searching this thread for the phrase "--connect-existing" to see how it's done. 2 hours ago, Letraindusoir said: if there is no existing Chrome browser, it can open the URL; If a Chrome browser process already exists, it would open a new TAB, and show in the address bar " Data:," but can't open the site Again, I can't diagnose what might be going wrong without some code. Also, be sure to post the results from the Scite output window. 2 hours ago, Letraindusoir said: Chrome browser always prompts: Chrome is being controlled by automatic test software. It is said that can add the option "disable-infobars" to solve this problem, but do not know how to add. Use the forum search feature to find multiple instances of using this option. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Letraindusoir Posted April 30, 2019 Share Posted April 30, 2019 (edited) 6 hours ago, Danp2 said: please post code showing what you have tried. The code is as follows: #include "wd_core.au3" Local $sDesiredCapabilities $_WD_DEBUG = False SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.88countryclub.co.kr/") $hwnd = WinWaitActive("88") WinSetState($hwnd, "", @SW_MAXIMIZE) Sleep(1000) ControlSend($hwnd, "", "", "^f") Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path=' & @ScriptDir & '\chrome.log') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true}}}}' EndFunc If a Chrome browser process already exists,"chrome.log " show that: Quote [1556638929.643][INFO]: Launching chrome: "chrome.exe" --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-automation --enable-logging --force-fieldtrials=SiteIsolationExtensions/Control --ignore-certificate-errors --load-extension="X:\MESS\TEMP\USER\scoped_dir2956_15868\internal" --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12279 --test-type=webdriver --use-mock-keychain --user-data-dir="X:\MESS\TEMP\USER\scoped_dir2956_12958" data:, Edited April 30, 2019 by Letraindusoir Link to comment Share on other sites More sharing options...
Danp2 Posted April 30, 2019 Author Share Posted April 30, 2019 @Letraindusoir Chrome doesn't allow you to connect to an existing instance via the webdriver. Note: I haven't tried launching Chrome with script #1 and then interacting with this instance from script #2 by sharing the session id between scripts. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Letraindusoir Posted May 1, 2019 Share Posted May 1, 2019 18 hours ago, Danp2 said: @Letraindusoir Chrome doesn't allow you to connect to an existing instance via the webdriver. Note: I haven't tried launching Chrome with script #1 and then interacting with this instance from script #2 by sharing the session id between scripts. It seems that I still know too little, and I have to study hard and familiarize myself with it. Link to comment Share on other sites More sharing options...
Letraindusoir Posted May 3, 2019 Share Posted May 3, 2019 $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions":{"w3c": true,"pageLoadStrategy":"none"}}}}' Quote [1556847178.757][INFO]: RESPONSE InitSession unknown error: cannot parse capability: goog:chromeOptions from unknown error: unrecognized chrome option: pageLoadStrategy Does "chromedriver" not support the use of "pageLoadStrategy"? Link to comment Share on other sites More sharing options...
Danp2 Posted May 3, 2019 Author Share Posted May 3, 2019 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