in reply to Screenshot with Perl

Are you trying to create a file with a name like this ?

C:/Users/user1/Documents/TESTPERL/Website-https://www.tricentis.com/.png

Try just using the row numbers

$driver->capture_screenshot("$path/Website-$row.png");

poj

Replies are listed 'Best First'.
Re^2: Screenshot with Perl
by Perlchaoui (Sexton) on Nov 12, 2018 at 11:21 UTC

    Thaank you Poj ! You are a killer ( in the good sense of the term)

    With your support, i understood now from where is coming the issue. Obviously, the png doc cannot store the url name as is

    Again thanks for the support. I just don't know why in IT University we start to learn at the beginning Java or C languages and not Perl which is a powerful , useful and beautiful language..

      With your support, i understood now from where is coming the issue.

      Sometimes it's very useful to simply see what you're doing. A humble print statement can help:

      my $path = "C:/Users/user1/Documents/TESTPERL"; ... my $url = some_func(...); ... my $filename = "$path/Website-$url.png"; print "DEBUG: screenshot filename: '$filename'"; # FOR DEBUG only $driver->capture_screenshot($filename); ...
      Had you seen this output during debugging, it would probably have been immediately obvious that "... the png doc cannot store the url name as is".

      See also the Basic debugging checklist; these techniques will allow you to support yourself.


      Give a man a fish:  <%-{-{-{-<

      I just don't know why in IT University we start to learn at the beginning Java or C languages and not Perl which is a powerful , useful and beautiful language..

      I think this would make a great perlmonks poll, because there are so many provocative reasons for this sad state of affairs (sad for the grads, that is =).

        Sad newz indeed Anonymous Monk. Hope this will change in the future. First time i have heard about Perl, it is in my company.

        As you said it could be a good perlmonks poll or a Perl conference topic

      You are a killer ( in the good sense of the term)

      Off topic, just chiming in to say, generally in the sense you mean, in US English, killer is an adjective not a noun. So, you are killer is more on target and not in need of qualification. Maybe the expression killer app is muddying the idiom.