Selenium-Remote-Driver

 view release on metacpan or  search on metacpan

at/sanity-chrome.test  view on Meta::CPAN

my $coords = {
   latitude  => 40.714353,
   longitude => -74.005973,
};
ok($driver->set_geolocation(location => $coords),"can set_geolocation in krom");
is( $driver->get_geolocation()->{latitude},$coords->{latitude},"cang get_geolocation in krom");

ok($driver->get_log('server'), "get_log fallback works");
ok( scalar(@{$driver->get_log_types()}),"can fallback for get_log_types");

isnt(exception { $driver->set_orientation("LANDSCAPE") },undef,"set_orientation unavailable on desktop");
like(exception { $driver->get_orientation() },qr/error/,"get_orientation unavailable on desktop");

like($driver->upload_file($otherloc),qr/other.html$/,"upload_file fallback works");

#Jinkies, this stuff is cool, it prints the selenium server help page @_@
like( exception { $driver->get_local_storage_item('whee') },qr/help/i,"get_local_storage_item prints help page");
like( exception { $driver->delete_local_storage_item('whee') },qr/help/i,"get_local_storage_item prints help page");

ok($driver->switch_to_frame($driver->find_element('frame', 'id')),"can switch to frame (WD3)");
ok($driver->switch_to_frame(),"can switch to parent frame (WD3 only)");

lib/Selenium/Remote/Driver.pm  view on Meta::CPAN

    });

 Output:
    BOOLEAN - success or failure

=head2 get_geolocation

 Description:
    Get the current geographic location. Note that your webdriver must
    implement this endpoint - otherwise, it will crash your session. At
    the time of release, we couldn't get this to work on the desktop
    FirefoxDriver or desktop Chromedriver.

 Usage:
    print $driver->get_geolocation;

 Output:
    { latitude: number, longitude: number, altitude: number } - The current geo location.

=head2 get_log

 Description:

t/01-driver.t  view on Meta::CPAN

        'Coerce ms arguments for set_timeout' );
    ok( exception{ $driver->set_async_script_timeout( $invalid_ms ) },
        'Coerce ms arguments for set_async_script_timeout' );
    ok( exception{ $driver->set_implicit_wait_timeout( $invalid_ms ) },
        'Coerce ms arguments for set_implicit_wait_timeout' );

    $ret = $driver->get("$website/frameset.html");
    $ret = $driver->switch_to_frame('second');

  SKIP: {
        skip 'Cannot rotate desktop browsers', 3;
        ok($driver->get_orientation eq 'PORTRAIT', 'Can get default orientation');
        $ret = $driver->set_orientation('LANDSCAPE');
        ok($ret, 'Can change orientation to LANDSCAPE');
        ok($driver->get_orientation eq 'LANDSCAPE', 'Can get changed orientation');
    }
}

COOKIES: {
    $driver->get("$website/cookies.html");
    $ret = $driver->get_all_cookies();



( run in 0.265 second using v1.01-cache-2.11-cpan-299005ec8e3 )