Jump to content

Recommended Posts

Posted

hello, You can help me, I use chrome selenium to login but it doesn't show the profile I created :((

 

#include "wd_core.au3"
#include "wd_helper.au3"
#include "EncodeHtmlEntities.au3"
#RequireAdmin
Local    $sDesiredCapabilities,$sSession,$Sv_Data,$File_Error,$time_delay
        $user_profile='C:\\Users\\24h\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1'


        _WD_Option('Driver', 'chromedriver.exe')
        _WD_Option('Port', 9515)
        _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')
        $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true,"args":["user-data-dir='&$user_profile&'"] }}}}'

        _WD_Startup()
        Sleep(7000)
        $sSession=_WD_CreateSession($sDesiredCapabilities)
        _WD_Navigate($sSession,'https://www.google.com')
        _WD_LoadWait($sSession)

152064347_Screenshot2020-02-2710_03_28.thumb.png.53fb723e5ba301b488553a41e74b3dfa.png

Posted

Your code runs fine in my computer.

You said you created the profile. Does that folder (Profile 1) have exactly the same subfolders and files as in the default user data directory? If not, chromedriver will not start. You should rather specify a non-existing folder ( "user-data-dir=c:\users\profile 1", for example) and run the code so that the chrome may create the folder to suit its requirements.

Posted

the folder I created when creating a new profile in chrome default.  I want to sign in to google when I enter the browser with chrome selenium

Posted

Please check if the 2 user data directories are identical: the one created for chrome.exe and logged in to gmail and the other one used by chromedriver. You can do it by typing chrome://version in the address bar and Enter key in both browser instances. As I said above, you should close the first instance of chrome before running chromedriver. If they are identical and you still don't have the same google profile, it is beyond my comprehension.

Posted
  On 2/27/2020 at 8:11 AM, CYCho said:

Please check if the 2 user data directories are identical: the one created for chrome.exe and logged in to gmail and the other one used by chromedriver. You can do it by typing chrome://version in the address bar and Enter key in both browser instances. As I said above, you should close the first instance of chrome before running chromedriver. If they are identical and you still don't have the same google profile, it is beyond my comprehension.

Expand  

Can you tell me which folder contains gmail account management data (on pc)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...