And i have following issue, STDOUT in my Shell:my $root ='//a[@href="/"]'; my @name = ('//a[@href="/install/kit"]','//a[@href="/license/view" +); my @snapname = ("Installkit","Licenseview"); sub myHomeTest { my ( $RefName, $RefSnapname ) = @_; my $elem = $driver->find_element($root); # Other way to get Xpa +th: $elem = $driver->find_element("//a[\@href='/']"); $driver->mouse_move_to_location(element => $elem); # xoffset => +x, yoffset => y foreach my $name ( @{RefName}){ $driver->click_element_ok($name, 'xpath', "Loaded"); } $driver->pause(3000); foreach my $name ( @{RefSnapname}){ $driver->capture_screenshot("$path/snap$snapname-$browser.png"); } $driver->get_ok("$base_url","get Home url"); $driver->pause(2000); } myHomeTest ($root, $name, $snapname);
Variable "$elem" will not stay shared at MyTestingSuite.pm line 169.
Variable "$driver" will not stay shared at MyTestingSuite.pm line 169.
Variable "$root" will not stay shared at MyTestingSuite.pm line 169.
Variable "$browser" will not stay shared at MyTestingSuite.pm line 176.
Global symbol "@RefName" requires explicit package name at MyTestingSuite.pm line 171.
Global symbol "@RefSnapname" requires explicit package name at MyTestingSuite.pm line 175
Global symbol "$snapname" requires explicit package name at MyTestingSuite.pm line 176.
Global symbol "$name" requires explicit package name at MyTestingSuite.pm line 182.
Global symbol "$snapname" requires explicit package name at MyTestingSuite.pm line 182.
In reply to Re^3: One function with 2 calls
by Chaoui05
in thread One function with 2 calls with Selenium
by Chaoui05
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |