Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

hello Doozer,

Not a solution, but I rewrote the beginning of your script using a hash to avoid having to test before $hostname assignment. Loop variables probably shouldn't be declared globally either. Anyways, here's what I came up with.

#!/usr/bin/perl use strict; use warnings; my %hosts = ( "192.168.1.206" => "Windows_XP", "192.168.1.207" => "Windows_Vista", "192.168.1.208" => "Windows_7", "192.168.1.230" => "MAC_OSX_Mountain_Lion", "192.168.1.231" => "MAC_OSX_Lion" ); my @browsers = qw/ firefox googlechrome iexplore /; my $browserurl = 'http://admin:sky@192.168.0.1/'; my $date = (localtime); foreach my $browser (@browsers) { foreach my $host (keys %hosts) { my $sel = Test::WWW::Selenium->new(host => "$host", port => 5555, browser => $browser, browser_url => "http://192. +168.0.1" ); my $hostname = $hosts{$host}; open STDOUT, "+>/varwww/cgi-bin/Perl-Scripts/$hostname\_$brows +er\.txt" or die "Failed to open $hostname\_$browser.txt: $!\n"; print "$host - $hostname - $browser - $date\n\n"; } }

Happy Tuesday.


In reply to Re: Perl and Selenium Grid 2 - Redirecting STDOUT not working how I need it to. by marquezc329
in thread Perl and Selenium Grid 2 - Redirecting STDOUT not working how I need it to. by Doozer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found