Re: [Http-webtest-general] Another feature request....
Brought to you by:
m_ilya,
richardanderson
From: Ed F. <ed....@la...> - 2003-04-01 15:37:45
|
Hi, I do something similar, but in Perl. In this case I have a file of the form NN All type Tag/attribute attributeValue/TagValue tag dfn tag acronym tag h1 att class body att style att style overflow:none I loop through each line extracting tag's and attributes. Certainly you could do something similar changing $webpage each time. I don't normally use wt_script so I'm not that familiar with it. sub build_tests($ $) { my ($webpage, $testlocation) = @_; open(TESTFILE, "<" .$testlocation) || die "can't open datafile: $!"; print "Test file " . <TESTFILE>; print "Test file Format" . <TESTFILE>; my @result; while(<TESTFILE>) { my @line = split; if ($line[0] eq 'tag') { @result = (@result, {test_name => $line[1] . ' tag', url => $webpage, regex_forbid => [ "<\\s*".$line[1]."[^>]*>" ]}); } if ($line[0] eq 'att' && $line[2]) { @result = (@result, {test_name => $line[1] ."=".$line[2]. ' att', url => $webpage, regex_forbid => [ $line[1]."\\s*=\\s*[\'\"]?[^\'\"]*".$line[2] ]}); } elsif ($line[0] eq 'att') # only att { @result = (@result, {test_name => $line[1] . ' att', url => $webpage, regex_forbid => [ $line[1]]}) ; } } return \@result; } Ed Fancher Ethercube Solutions http://www.ethercube.net PHP, Perl, MySQL, Javascript solutions. ----- Original Message ----- From: "Amit Kaul" <ak...@ho...> To: <htt...@li...> Sent: Tuesday, April 01, 2003 11:16 AM Subject: [Http-webtest-general] Another feature request.... > Hi Ilya, > > Since you are so accomodating :-), I was wondering if there was a > possibility of dynamically creating URL's to test. > > i.e. see second test > > test_name = GET First Page > url = http://abc.com/ > on_response = { > my $webtest = shift; > ($URL_PATH) = $webtest->current_response->content =~ /\"URL=(\S+)"\)'; > []; > } > end_test > > test_name = GET Second URL > url = http://abc.com/"$URL_PATH" > end_test > > Thanks, > Amit > > > _________________________________________________________________ > Tired of spam? Get advanced junk mail protection with MSN 8. > http://join.msn.com/?page=features/junkmail > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > Http-webtest-general mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/http-webtest-general > |