Hi All, I am facing a problem while running a perl script through selenium RC server . I recorded oone log in test case with slenium IDE and run it after that with the ide only and it worked fine . After I exported that test case as a perl script . I installed all the required modules (like Test::WWW::Selenium,Test::More,Test::Exception)by PPM GUI (As I am using active perl 5.10 on winxp).I run the Selenium Rc server and tried to execute my below code .
# use strict; # use warnings; # use Time::HiRes qw(sleep); # use Test::WWW::Selenium; # use Test::More "no_plan"; # use Test::Exception; # # my $sel = Test::WWW::Selenium->new( host => "localhost", # port => 4444, # browser => "*firefox", # browser_url => "http://localhost +:28080/" ); # # my $s = $sel->open_ok("/interop/index.jsp"); # print " \n Test Script \n "; # print " \n \n my var $s \n \n"; # $sel->set_speed("1000"); # without this line, everything will + error out. # $sel->wait_for_page_to_load_ok("100000"); # sleep (50); # $sel->type_ok("bpm.Logon.1.txtPassword", "password"); # $sel->click_ok("bpm.Logon.1.btnLogon");
and after executing that code the broswer opens that url page and the status shows as "done". But In that opened page no UI elements are there like text box and buttons , It is a blank page . The console result shows :
# D:\selenium_sc_HSS\RC>perl pl3.pl # ok 1 - open, http://localhost:19000/interop/index.jsp # # Test Script # # # my var 1 # # ok 2 - wait_for_page_to_load, 100000 # # Error requesting http://localhost:4444/selenium-server/driver/: # # ERROR: Element bpm.Logon.1.txtPassword not found # not ok 3 - type, bpm.Logon.1.txtPassword, password # # Failed test 'type, bpm.Logon.1.txtPassword, password' # # at pl3.pl line 27. # # Error requesting http://localhost:4444/selenium-server/driver/: # # ERROR: Element bpm.Logon.1.btnLogon not found # not ok 4 - click, bpm.Logon.1.btnLogon # # Failed test 'click, bpm.Logon.1.btnLogon' # # at pl3.pl line 28. # 1..4 # # Looks like you failed 2 tests of 4.
Because of the page element text box with ID "bpm.Logon.1.txtPassword" is not loaded (As I mentioned it is coming as blank page) the script is throwing error as "Element bpm.Logon.1.btnLogon not found" Can any one help me on this why the page is not getting loaded fully though the firefox browser status is showing "done" and the same test case is loading the page fully with selenium IDE . Advance thanks for any input on this..!!

In reply to Unable to get web page element while running perl script with selenium RC server . by som

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.