Hi,
during of an in-house frame-based application I ran into an issue with links that have the target '_self'.
It looks like Selenium RC is not aware that '_self' means the current frame or window.
I have boiled it down to small example:
/noaut/test_target_self.html:
<head>
<head>
<title>Test target _self with Selenium RC 0.9.1</title>
</head>
<body>
<a href='test_target_self.html' >without target</a>
<a href='test_target_self.html' target='_self' >with target</a>
</body>
Perl 5 test script:
use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
my $sel = Test::WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*firefox",
browser_url => 'http://test.example.org:8824' );
$sel->open_ok("/noauth/test_target_self.html");
$sel->title_is("Test target _self with Selenium RC 0.9.1");
$sel->click_ok("link=without target");
$sel->wait_for_page_to_load_ok("30000");
$sel->title_is("Test target _self with Selenium RC 0.9.1");
$sel->click_ok("link=with target");
$sel->wait_for_page_to_load_ok("30000");
$sel->title_is("Test target _self with Selenium RC 0.9.1");
Unexpected output:
bernhard@fumarat:~/devel/selenium/bmax_testing$ prove test_target_self.t
test_target_self....ok 1/0# Error requesting http://localhost:4444/selenium-server/driver/?cmd=click&1=link%3Dwith%20target&sessionId=566036:
- ERROR: Window does not exist
- Failed test 'click, link=with target'
- in test_target_self.t at line 16.
test_target_self....NOK 6# Error requesting http://localhost:4444/selenium-server/driver/?cmd=waitForPageToLoad&1=30000&sessionId=566036:
- Timed out after 30000ms
- Failed test 'wait_for_page_to_load, 30000'
- in test_target_self.t at line 17.
test_target_self....ok 8/0# Looks like you failed 2 tests of 8.
test_target_self....dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 6-7
Failed 2/8 tests, 75.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
test_target_self.t 2 512 8 2 25.00% 6-7
Failed 1/1 test scripts, 0.00% okay. 2/8 subtests failed, 75.00% okay.
bernhard@fumarat:~/devel/selenium/bmax_testing$
I hope that helps,
Bernhard