in reply to Set a screenshot from Selenium package in a variable

Why don't you do what you do for $browser also for the path?

Replies are listed 'Best First'.
Re^2: Set a screenshot from Selenium package in a variable
by Chaoui05 (Scribe) on Apr 27, 2016 at 14:05 UTC
    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 !

      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 !