webappsstore.sqlite in temporary profile folder is empty

58 views
Skip to first unread message

Georg Horn

unread,
Jan 18, 2018, 1:50:19 PM1/18/18
to Selenium Remote Driver
Hi, i already asked this question in the selenium user group: https://groups.google.com/forum/#!topic/selenium-users/1ueA7xhRyjQ

Perhaps someone here has an idea?

George Baugh

unread,
Jan 19, 2018, 9:39:24 PM1/19/18
to Selenium Remote Driver
it sounds like there's some kind of sqlite file being made and then chucked into local storage, which you then are trying to read from the local disk to verify some action worked, correct?

If so, I'm guessing what's going on is that the temporary profile is being nuked everytime geckodriver starts up (this makes sense, otherwise we'd have insufficient isolation between runs).
That's why the moz:firefoxOptions->profile and the moz:firefoxOptions->args capabilities exist, after all.

My recommended way around that would be to create a new firefox profile on the local disk, and to then specify it through args, e.g. qw{ -profile /path/to/file}.

If you wait until 1.21 gets indexed on CPAN, you can also just install it and do:

Selenium::Remote::Driver->new( profile => 'path/to/file/' )

And it should construct the capabilities for geckodriver to 'do the right thing'.  If it doesn't please file a case on it.

Georg Horn

unread,
Jan 31, 2018, 9:19:38 AM1/31/18
to Selenium Remote Driver
Am Samstag, 20. Januar 2018 03:39:24 UTC+1 schrieb George Baugh:
it sounds like there's some kind of sqlite file being made and then chucked into local storage, which you then are trying to read from the local disk to verify some action worked, correct?

Not exactly, the website stores items into the browsers local storage and reuses these items on the next visit to the website. The browser saves these local storage items in the file webapsstore.sqlite in its profile folder, just as it stores cookies in cookies.sqlite. Its basically a "remember me" functionality, you log in once with a password and at future visists to the site from the same computer you are logged in automagically.
 
If so, I'm guessing what's going on is that the temporary profile is being nuked everytime geckodriver starts up (this makes sense, otherwise we'd have insufficient isolation between runs).

Yes, it looks as if selenium and/or geckodriver do not make an exact copy of the original profile folder, even if you specify -Dwebdriver.firefox.profile=profilename when starting selenium server. And this does not always make sense if you want to monitor an application that needs cookies or local storage items from the previous testrun.

Whatever, basically the question is: How to start firefox with a given profile folder?

That's why the moz:firefoxOptions->profile and the moz:firefoxOptions->args capabilities exist, after all.

My recommended way around that would be to create a new firefox profile on the local disk, and to then specify it through args, e.g. qw{ -profile /path/to/file}.

If you wait until 1.21 gets indexed on CPAN, you can also just install it and do:

Selenium::Remote::Driver->new( profile => 'path/to/file/' )

And it should construct the capabilities for geckodriver to 'do the right thing'.  If it doesn't please file a case on it.

This does not work. Firefox is started as usual with a temporary profile folder. From the selenium logfile:

1517407718804   mozrunner::runner       INFO    Running command: "/usr/bin/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.kTC7WyiucIZg"
1517407719976   Marionette      INFO    Enabled via --marionette
1517407723130   Marionette      INFO    Listening on port 49796

$driver = Selenium::Remote::Driver->new(
            extra_capabilities => {
                'acceptInsecureCerts' => JSON::true,
                'moz:firefoxOptions' => {
                    args => [ "-profile", "/home/horn/.mozilla/firefox/8bkxxzc6.lisi" ],
                },
            });

does start the browser with the profile folder:

1517407792560   mozrunner::runner       INFO    Running command: "/usr/bin/firefox" "-marionette" "-profile" "/home/horn/.mozilla/firefox/8bkxxzc6.lisi"
1517407792808   Marionette      INFO    Enabled via --marionette
1517407793430   Marionette      INFO    Listening on port 2828

but then it fails to connect to marionette: The portnumber is always 2828 in this case while it varies every time when i omit -profile ...
Reply all
Reply to author
Forward
0 new messages