|
Author
|
Topic: Can Perl script be used for testing automation ?
|
abhra Member
Posts: 32 Registered: May 2001
|
posted 10-15-2001 05:39 AM
Can u do pragramming for automation of testcase in perl both for standalone and web based application. If anybody is doing similar activity please help me providing necessary information to start with. I have perl installed in my pc.Thanking in advance Abhra
------------------

|
qa_tester Guru
   
Posts: 363 Registered: Aug 2001
|
posted 10-15-2001 06:55 AM
I've never done it, but i've heard of some ppl have created testing tools using perl scripting. So yes u can do it, but i'm sure how.------------------

|
bikerdude Member
Posts: 7 Registered: Sep 2001
|
posted 10-15-2001 07:49 AM
I developed a bunch of Perl code for automated testing a few years ago.I was developing automated tests for the API of a workflow and document management product. The APIs allowed you to do such things as check in/check out documents, create active workflows, assign tasks, starts tasks, etc. The API was in Java. Some of the developers had already written a bunch of Java test code for a lot of the APIs. My job was to continue developing additional test cases and write some type of driver program to automate the whole process. I was new to Java programing so I decided to write the test harness(driver) frist and then concentrate on learning Java and development of new test cases. The driver had to run on Win NT and Solaris. I wanted to use a common driver for both so I decided to use to Perl. It worked great as there was minimal code that was platform specific. If the only platform would have been Solaris I would have written a Bourne shell script as the driver. If the only platform had been Win NT I am not sure what I would have used. In retrospect I wish I had written the driver in Java but at the time that didn't seem to be an option.
------------------
Dave Draper QA Manager GeoTrust

|
alanark Guru
   
Posts: 369 Registered: Dec 2000
|
posted 10-17-2001 09:18 AM
**Camel Head passing thru**Of course you can program a test suite via perl. I have done this for API testing, data quality verification, and even some web testing. I guess it all comes down to what are you hoping to accomplish. What types roadmap for your tests have you ALREADY created. Is there a toolset that might be better than trying to roll your own in perl? Are you comfortable in programming perl on your own? What are the ramifications if your test suite does not work correctly? Some issues to think about before going down this path, but the answer is that you can certainly create a test suite written completely in perl. IMHO, I mainly use it these days to set up data so that I can use some of the other tools in house to actually drive the tests... ie performance testing, regression testing tools that have more functionality and flexability than what I could whip up using perl and 1 month of my time. Esp since it needs to get out by tommorrow!! Oh No! Good Luck. ------------------

|
Beowulf Member
Posts: 34 Registered: Oct 2001
|
posted 10-17-2001 10:25 AM
Hi there, at the company where I work we do alot of perl, and as a such we need to test it. However one really nice part about using Pearl is there are many excellent test modules avalable from CPAN. Apache::Test is one that we are currently evaluating for testing some of our web based content. Of course with the robustness of perl it is also pretty easy to write a quick and dirty test script as well. So the simple answere is Heck Yeah no problem. However if you are not a Perl developer be shure make sure that you budget development resources to produce the scripts.Oh and be sure and check out CPANCheers, Graham ------------------

|
abhra Member
Posts: 32 Registered: May 2001
|
posted 10-19-2001 04:20 AM
Thank You everybody who has provided valuable information regarding usability of perl for testing automation.Presently I am trying to automate GUI and functionality testing of an application. For that I am trying to use win32::setuusup and win32::GUITest modules installed from CPAN. While using those modules I have faced with some limitation. I want expert comments from those who have really used perl for GUI and functional testing automation. 1. I want to click on a particular button or menu. How perl will recognize my desired button or menu by it's properties . Function available are to recognize windows and perform all type of action on window only. But how to perform action on a particular controls of the window ? 2.Which are others modules that are usefull for GUI and Functional testing automation excepts Win32::API,Win32::GUITest Win32::Setupsup,termReadKey etc. I have used those modules,but did not find the way to recognize a controlls. 3.All the modules mention above are applicable for Windows based application. Which are the modules usefull for the automation of non-Windows based application.
------------------

|
alanark Guru
   
Posts: 369 Registered: Dec 2000
|
posted 10-19-2001 11:23 AM
Ah, you want to manipulate the control inside the window... classic problem with no easy soln. Even with COTS regression tools, there is always a question on how to recognize/manipulate the controls. This typically cannot be done out of the box, as some programming is needed for this functionality.As far as testing Non-Windows applications using perl. I'd say that it should be able to be done, but I guarantee that thw Win32::* modules are the wrong ones. Good Luck. ------------------

|
abhra Member
Posts: 32 Registered: May 2001
|
posted 10-29-2001 02:34 AM
thank you alanark for reply Can u please guide how to do programming for those functionality. I am already using some modules like win32::GuiTest,win32::Setupsup and also some Windows Api function but with litle success. Can U please help me providing guideline?Thanks abhra quote: Originally posted by alanark: Ah, you want to manipulate the control inside the window... classic problem with no easy soln. Even with COTS regression tools, there is always a question on how to recognize/manipulate the controls. This typically cannot be done out of the box, as some programming is needed for this functionality.As far as testing Non-Windows applications using perl. I'd say that it should be able to be done, but I guarantee that thw Win32::* modules are the wrong ones. Good Luck.
------------------

|
alanark Guru
   
Posts: 369 Registered: Dec 2000
|
posted 10-29-2001 12:10 PM
As far as good learning docs on programming the Win32 Libs - not many books out there, and for your specific modules, I'm not sure if any exists. Your best bet might be to try www.perl.com and try to see what you can dig up. The docs included with the lib should give you some idea on how to actually use them, but there might be some good examples of the code in use at perl.com. Even better might be activestate.com which hosts all of the Win32 specific thingies. There is a mailing list available for WIn32 users that you might want to examine as well.www. activestate.com Happy Hunting.
------------------

|
abhra Member
Posts: 32 Registered: May 2001
|
posted 11-02-2001 03:02 AM
Hi Alanark Thank u for reply Presently I am trying to do automated GUI and Functional Testing using perlI am using perl since last sometimes. I have used various perl module for that purpose(like win32::GuiTest,win32::Setupsup,win32::Api etc....). But I didn't find solution to my problem I have following problem : 1. How to recognize individual control of an window. Suppose I want to click on a particular control like menu,button. 2. How can I retrieve properties of a control( caption or text, item of listbox) 3. How to do event handling in perl . By Tk module u can do event handling on GUI application written in perl. But I want event handling on application that are not written in perl. Like on mouse click event I want to retrieve caption of the button or any others properties. Recently I am trying to call Windows API from perl for a solution to above problem. But some the API is not working correctly without any apparent reason. Now I am thinking to use C or C++ with perl. I thinnk I can use all windows API correctly in C or C++ and then I will use the module into perl. Do u think it's right approach ? Please help me with proper guidance. Thanking you Abhra ------------------

|
Corey_G Advanced
 
Posts: 158 Registered: Sep 2001
|
posted 11-05-2001 08:10 AM
for a web based application, you may want to skip the GUI layer and test from the HTTP Protocol layer (of course this depoends on what the goals for your tool are).for doing something like this, you can easily build web based test clients using some of the following modules: HTTP::Request HTTP::Cookies LWP::UserAgent CGI look at CPAN and perl.com for info. and of course if you want to get down and dirty with Perl, buy the Camel! (the O'Reilly Perl book with the camel on the cover.. AKA the bible). Also, there is an excellent book from O'Reilly, written by Clinton Wong. It is called "Web Client Programming With Perl". This is the best resource I have seen for building perl/cgi web clients. Unfortunately it is out of print, but its full contents are available on the web (do a google search). -Corey ------------------

|