GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Selenium::Firefox::Profile(3) User Contributed Perl Documentation Selenium::Firefox::Profile(3)
 

Selenium::Firefox::Profile - Use custom profiles with Selenium::Remote::Driver

version 1.30

You can use this module to create a custom Firefox Profile for your Selenium tests. Currently, you can set browser preferences and add extensions to the profile before passing it in the constructor for a new Selenium::Remote::Driver or Selenium::Firefox.

    use Selenium::Remote::Driver;
    use Selenium::Firefox::Profile;
    my $profile = Selenium::Firefox::Profile->new;
    $profile->set_preference(
        'browser.startup.homepage' => 'http://www.google.com',
        'browser.cache.disk.capacity' => 358400
    );
    $profile->set_boolean_preference(
        'browser.shell.checkDefaultBrowser' => 0
    );
    $profile->add_extension('t/www/redisplay.xpi');
    my $driver = Selenium::Remote::Driver->new(
        'firefox_profile' => $profile
    );
    $driver->get('http://www.google.com');
    print $driver->get_title();

profile_dir - <string> directory to look for the firefox profile. Defaults to a Tempdir.

Set string and integer preferences on the profile object. You can set multiple preferences at once. If you need to set a boolean preference, either use JSON::true/JSON::false, or see "set_boolean_preference()".
    $profile->set_preference("quoted.integer.pref" => '"20140314220517"');
    # user_pref("quoted.integer.pref", "20140314220517");
    $profile->set_preference("plain.integer.pref" => 9005);
    # user_pref("plain.integer.pref", 9005);
    $profile->set_preference("string.pref" => "sample string value");
    # user_pref("string.pref", "sample string value");

Set preferences that require boolean values of 'true' or 'false'. You can set multiple preferences at once. For string or integer preferences, use "set_preference()".
    $profile->set_boolean_preference("false.pref" => 0);
    # user_pref("false.pref", false);
    $profile->set_boolean_preference("true.pref" => 1);
    # user_pref("true.pref", true);

Retrieve the computed value of a preference. Strings will be double quoted and boolean values will be single quoted as "true" or "false" accordingly.
    $profile->set_boolean_preference("true.pref" => 1);
    print $profile->get_preference("true.pref") # true
    $profile->set_preference("string.pref" => "an extra set of quotes");
    print $profile->get_preference("string.pref") # "an extra set of quotes"

Add an existing ".xpi" to the profile by providing its path. This only works with packaged ".xpi" files, not plain/un-packed extension directories.
    $profile->add_extension('t/www/redisplay.xpi');

Primarily for internal use, we set the appropriate firefox preferences for a new geckodriver session.

Primarily for internal use. This adds the fxgoogle .xpi that is used for webdriver communication in FF47 and older. For FF48 and newer, the old method using an extension to orchestrate the webdriver communication with the Firefox browser has been obsoleted by the introduction of "geckodriver".

Primarily for internal use, configure Marionette to the current Firefox profile.

Please see those modules/websites for more information related to this module.
Selenium::Remote::Driver
<http://kb.mozillazine.org/About:config_entries>
<https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences>

Please report any bugs or feature requests on the bugtracker website https://github.com/teodesian/Selenium-Remote-Driver/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

Current Maintainers:
Daniel Gempesaw <gempesaw@gmail.com>
Emmanuel Peroumalnaïk <peroumalnaik.emmanuel@gmail.com>
Previous maintainers:
Luke Closs <cpan@5thplane.com>
Mark Stosberg <mark@stosberg.com>
Original authors:
Aditya Ivaturi <ivaturi@gmail.com>

Copyright (c) 2010-2011 Aditya Ivaturi, Gordon Child
Copyright (c) 2014-2017 Daniel Gempesaw
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
2018-09-17 perl v5.28.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.