| 1 | package Selenium::Driver::Auto; | ||||||||||||||||||||||
| 2 | 1 | $Selenium::Driver::Auto::VERSION = '2.01'; | |||||||||||||||||||||
| 3 | #ABSTRACT: Automatically choose the best driver available for your browser choice | ||||||||||||||||||||||
| 4 | |||||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 7 | |||||||||||||||||||||||
| 8 | 1 | ▶ | use Carp qw{confess}; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 9 | 1 | ▶ | use File::Which; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 10 | |||||||||||||||||||||||
| 11 | # Abstract: Automatically figure out which driver you want | ||||||||||||||||||||||
| 12 | |||||||||||||||||||||||
| 13 | |||||||||||||||||||||||
| 14 | 0 | ▶ | sub build_spawn_opts { | ||||||||||||||||||||
|
Subroutine
build_spawn_opts: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||
| 15 | |||||||||||||||||||||||
| 16 | # Uses object call syntax | ||||||||||||||||||||||
| 17 | 0 | my ( undef, $object ) = @_; | |||||||||||||||||||||
| 18 | |||||||||||||||||||||||
| 19 | 0 | ▶ | if ( $object->{browser} eq 'firefox' ) { | ||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||
| 20 | 0 | require Selenium::Driver::Gecko; | |||||||||||||||||||||
| 21 | 0 | return Selenium::Driver::Gecko->build_spawn_opts($object); | |||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||
| 23 | elsif ( $object->{browser} eq 'chrome' ) { | ||||||||||||||||||||||
| 24 | 0 | require Selenium::Driver::Chrome; | |||||||||||||||||||||
| 25 | 0 | return Selenium::Driver::Chrome->build_spawn_opts($object); | |||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||
| 27 | elsif ( $object->{browser} eq 'MicrosoftEdge' ) { | ||||||||||||||||||||||
| 28 | 0 | require Selenium::Driver::Edge; | |||||||||||||||||||||
| 29 | 0 | return Selenium::Driver::Edge->build_spawn_opts($object); | |||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||
| 31 | elsif ( $object->{browser} eq 'safari' ) { | ||||||||||||||||||||||
| 32 | 0 | require Selenium::Driver::Safari; | |||||||||||||||||||||
| 33 | 0 | return Selenium::Driver::Safari->build_spawn_opts($object); | |||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||
| 35 | 0 | require Selenium::Driver::SeleniumHQ::Jar; | |||||||||||||||||||||
| 36 | 0 | return Selenium::Driver::SeleniumHQ::Jar->build_spawn_opts($object); | |||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||
| 38 | |||||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||||
| 40 | |||||||||||||||||||||||
| 41 | __END__ | ||||||||||||||||||||||