简体   繁体   中英

How do I run/execute a Perl script using Selenium RC?

I use Selenium IDE to record and replay the test case. I have exported the test case as Perl and saved it as test.pl . When I run perl test.pl , it throws an error as some element not found, whereas same test case works perfectly in Selenium IDE. How can I run/execute this Perl script using Selenium RC? Active Perl is also installed.

You don't run the perl script from within Selenium, you run the test script and it connects to the selenium server. You'll need to figure out what's not happening in step 3.

You can add pauses and get the html source of a page to help in debugging this sort of thing. See the docs for WWW::Selenium for details. The auto-generated scripts aren't as clear as a script you'd write yourself by hand. I've actually found it helps to keep my sites' markup clean since I don't want to waste time figuring out how to select something nested deep within divs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM