Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Set a screenshot from Selenium package in a variable

by Chaoui05 (Scribe)
on Apr 27, 2016 at 14:05 UTC ( [id://1161632]=note: print w/replies, xml ) Need Help??


in reply to Re: Set a screenshot from Selenium package in a variable
in thread Set a screenshot from Selenium package in a variable

Here what i did for $browser :
my $self = shift; $self->{browsers} = [('chrome', 'phantomjs', 'firefox', 'internet ex +plorer')];

and

my $driver = Test::Selenium::Remote::Driver->new( browser_name => $bro +wser );
For snap's name i know but to do it with path i don't know how . And what are my issues with my forward code ?! Thanks again !

Replies are listed 'Best First'.
Re^3: Set a screenshot from Selenium package in a variable
by Corion (Patriarch) on Apr 27, 2016 at 14:09 UTC

    You have the following code:

    $driver->capture_screenshot("D:/dev/drivers/snap-$browser.png");

    There, you use the $browser variable to construct a part of the filename.

    You can do the same for other parts of the filename:

    my $target = "D:/dev/drivers/"; $driver->capture_screenshot("$target/snap-$browser.png");
      Thanks ! I did almost the same thing . I just paste a bad code here. I did
      my $path; $path ="D:/dev/drivers/";

      Many thanks it works !

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1161632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found