Jump to content

Refus

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Refus

  1. Ah, thank you. After figuring out the formatting for the parameters, Window.open() works great for this.
  2. Thanks for the direction. Have another question, Which function may I use to open a new separate window in the same session? Or perhaps something to pull an existing tab into its own window. Thank you for all your efforts, Danp2.
  3. I am looking to run chromedriver using a persistent chrome profile. I am having an issue getting my argument to pass to chromedriver I believe, because chromedriver continues to create a temp profile each session. The console reads that I have added the --user-data-dir, and I have used the following to make sure it is correct, but am having no luck yet. I am new to using Webdriver so as a starting point I am running a copy of wd_demo with only the DriverParams of SetupGoogle() changed. Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--user-data-dir="C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' EndFunc It seems that my params are being ignored, as the console writes that the profile being used is still the temp one _WDStartup: OS: WIN_10 WIN32_NT 17134 _WDStartup: AutoIt: 3.3.14.2 _WDStartup: WD.au3: 0.1.0.17 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --user-data-dir="C:\Users\Jan\AppData\Local\Google\Chrome\User Data" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"71.0.3578.98","chrome":{"chromedriverVersion":"2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387)","userDataDir":"C:\\Users\\Jan\\AppData\\Local\\Temp\\scoped_dir11284_12516"},"goog:chromeOptions":{"debuggerAddress":"localhost:50445"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows nt","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"},"sessionId":"ddca43a6ca34b812eab6e73a18a9d83f"}} My apologies if this is something simple. Thank you for your time. Edit: Accomplished this with $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}}'
  4. I have been having problems loading any User profile with Chrome other than the newly generated temporary one that Webdriver creates by default. I am using a copy of the wd_demo code just as a starting point, only having edited the DriverParams section of SetupChrome() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log" --user-data-dir="C:\Users\Jan\AppData\Local\Google\Chrome\User Data"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' EndFunc Despite adding (what I believe to be)the correct usage of --user-data-dir, chromedriver launches with the new temp Chrome profile every time. Console: _WDStartup: OS: WIN_10 WIN32_NT 17134 _WDStartup: AutoIt: 3.3.14.2 _WDStartup: WD.au3: 0.1.0.17 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --user-data-dir="C:\Users\Jan\AppData\Local\Google\Chrome\User Data" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"71.0.3578.98","chrome":{"chromedriverVersion":"2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387)","userDataDir":"C:\\Users\\Jan\\AppData\\Local\\Temp\\scoped_dir3068_9340"},"goog:chromeOptions":{"debuggerAddress":"localhost:64107"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows nt","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"},"sessionId":"c2ecb7bc400269fa73565ab43480120d"}} _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"71.0.3578.98","chrome":{"chromedriverVersion":"2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387)","userDataDir":"C:\\Users\\Jan\\AppData\\Local\\Temp\\scoped_dir3068_9340"},"goog:chromeOptions":{"debuggerAddress":"localhost:64107"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows nt","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"},"sessionId":"c2ecb7bc400269fa73565ab43480120d"}} I can see the temporary profile, but am unsure how to enforce that my -user-data-dir is followed. What am I missing? Thank you for your time.
×
×
  • Create New...