The new post by @ Brandon_Hein gave me a clue.
In my Chrome, I made a new proflile named Katalon
. My problem was finding out which directory under the C:\Users\<MyOsUserName>\AppData\Local\Google\Chrome\User Data
is linked to the new Katalon
profile.
In the directory, I found 3 profile directores which contains Preferences
file.
Default\Preferences
Profile 1\Preferences
Profile 2\Preferences
I look into all Preferences files, and found the Profile 2/Preferences
file contains the following code:
{
...
"profile": {
...
"name": "Katalon",
...
}
...
}
OK。Now I got it。All I need to do is as follows:
- locate the Chrome’s User Data directory:
C:\Users\<MyOsUserName>\AppData\Local\Google\Chrome\User Data
- identify the name of Profile in question:
Katalon
- search the User Data directory to look up subdirectories which contain a child
Preferences
file - parse the Preferences file, select the value of
/profile/name
node in the json. If the value of/profile/name
is equal to the Profile name in question (Katalon), then the directory is the one I want - now I know the Profile directory I want is
C:\Users\<MyOsUserName>\AppData\Local\Google\Chrome\User Data\<X>
This algorithm resolves the Profile name (Katalon) → the Directory name (X
) deterministically.
I would implement this as a Custom Keyword.