teodesian / Selenium-Remote-Driver

Perl Bindings to the Selenium Webdriver server
174 stars 90 forks source link

Could not create new session: Can't provide both a --profile argument and a profile #484

Closed hornschorsch closed 1 year ago

hornschorsch commented 1 year ago

Hi,

using SRD 1.47, geckodriver 0.32 and firefox 102.5-esr i get the above error message when trying to start a session as follows:

$driver = Selenium::Firefox->new(
                extra_capabilities => {
                    'moz:firefoxOptions' => {
                        args => [ "-profile", $moz_prof_dir ],
                     },
                }
            );

$moz_prof_dir contains the path of an existing profile with some browser extensions installed. The same worked with SRD 1.31.

As a quick and dirty fix i commented the lines 511 and 512 from Driver.pm:

else {
     #previously undocumented feature that we can pass the encoded profile
     #$args->{capabilities}->{alwaysMatch}->{'moz:firefoxOptions'}
         #->{profile} = $args->{capabilities}->{alwaysMatch}->{$cap};
}
hornschorsch commented 1 year ago

Is this project and Selenium finally dead?

teodesian commented 1 year ago

Lord I hope selenium is dying, but I doubt seriously it is going away anytime soon.

Given this is an undocumented feature that appears to be whacked, I'll patch it out now.

hornschorsch commented 1 year ago

Thanks and a happy new year!

I see that selenium is not the best software of the year but for me it is working and i have a lot of existing scripts and testcases defined that must be rewritten if i changed to another solution. I just set up a new machine with current versions of all software and stumbled across this problem. So thanks again for fixing!

teodesian commented 1 year ago

I should actually have time to work on open source again this year.

One of the things I very much wish to do this year is write a shim for Playwright-perl to make it a drop-in replacement for S::R::D.