473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Unable to get web page element while running perl script with selenium RC server .

16
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 .
Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use warnings;
  3. use Time::HiRes qw(sleep);
  4. use Test::WWW::Selenium;
  5. use Test::More "no_plan";
  6. use Test::Exception;
  7.  
  8. my $sel = Test::WWW::Selenium->new( host => "localhost", 
  9.                                     port => 4444, 
  10.                                     browser => "*firefox", 
  11.                                     browser_url => "http://localhost:28080/" );
  12.  
  13. my $s = $sel->open_ok("/interop/index.jsp");
  14. print " \n Test Script \n ";
  15. print " \n \n my var $s \n \n";
  16. $sel->set_speed("1000");        # without this line, everything will error out.
  17. $sel->wait_for_page_to_load_ok("100000");
  18. sleep (50);
  19. $sel->type_ok("bpm.Logon.1.txtPassword", "password");
  20. $sel->click_ok("bpm.Logon.1.btnLogon");
  21.  
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 :
Expand|Select|Wrap|Line Numbers
  1. D:\selenium_sc_HSS\RC>perl pl3.pl
  2. ok 1 - open, http://localhost:19000/interop/index.jsp
  3.  
  4.  Test Script
  5.  
  6.  
  7.  my var 1
  8.  
  9. ok 2 - wait_for_page_to_load, 100000
  10. # Error requesting http://localhost:4444/selenium-server/driver/:
  11. # ERROR: Element bpm.Logon.1.txtPassword not found
  12. not ok 3 - type, bpm.Logon.1.txtPassword, password
  13. #   Failed test 'type, bpm.Logon.1.txtPassword, password'
  14. #   at pl3.pl line 27.
  15. # Error requesting http://localhost:4444/selenium-server/driver/:
  16. # ERROR: Element bpm.Logon.1.btnLogon not found
  17. not ok 4 - click, bpm.Logon.1.btnLogon
  18. #   Failed test 'click, bpm.Logon.1.btnLogon'
  19. #   at pl3.pl line 28.
  20. 1..4
  21. # Looks like you failed 2 tests of 4.
  22.  
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..!!
Oct 25 '10 #1
0 2039

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: von | last post by:
Is it possible to run a Perl script from within a javascript? I have an existing javascript that provides some data - and I want to write that data to a text file on my server via a Perl script...
0
by: Thomas Blabb | last post by:
Sorry for this question but how do I write a simple "Hello world" HTML page from a perl script? In other words if I click in an already existing html page on a link like: .... <a...
2
by: carllucas | last post by:
I have no exprience with perl. What I'm trying to do is have a script/program constantly (perpetually) running on my server so that it performs a routine (like every hour) and automatic check of...
1
by: jman | last post by:
i've got a script that runs for a while... each time thru a loop - i'd like to update a page element (i.e. a progress bar). but it doesn't seem to happen - because i think pages are not...
1
by: satish2112 | last post by:
following is my Html code: <form name="form100" method="post" action="script.pl"> <textarea cols = "160" rows="12" name="TextArea1" > </textarea> <input align = "left" name="UpdateButton"...
1
by: Tension | last post by:
Hi. I have a Perl script that starts a build process (plus a lot of other things). The build process needs a few environment variables set. This is done automatically in a buildEnv.bat script...
5
by: tudorbalan | last post by:
I'm a complete beginner in Perl.In fact... I just need a perl script to upload files to server without having to use html <input type="file"> tag. I found a script...it works when I run it in cmd...
1
by: fortwilliam | last post by:
I have a newsletter system and want to have it work automatically. what I have so far works with a visitor to a page with a tiny iframe in it. This iframe calls up the send.pl newsletter script....
2
by: mithunmo | last post by:
I am trying to automate the process of filling up the webforms and do a submit . I have the below program written but If I run the program . I get the following error message Can't call method...
4
by: vijayarl | last post by:
Hi All, i have the following software installed in my system : 1.OS: Win2k 2.Eclipse Version used :3.4.0 & even the perl too... 1. I have imported the my own perl project in Eclipse, when i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.