Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18488 Posts in 4838 Topics- by 32654 Members - Latest Member: revitvm
 

AdvancedQTP forums have been nominated as a finalist in ATI’s 2nd annual automation honors awards!

We’d like to thank you for your continued support and participation, and urge you to hurry and vote.

Make you voice count! 


Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: webtesting uisng it    (Read 686 times)
niranjan deka
FRProject
Full User
*
Offline Offline

Posts: 226


« on: June 16, 2009, 03:23:17 AM »

Hi all,

I am totally new to this Autoit tool.But it seems to be very interesting. Please let to know how we can automate a website with bit details???.

Actually my intention is to know how it recognized or used the buttons or controls in the webform for the automation.

Thanks in advanced


regards
niranjan
Logged
Meir Bar-Tal
Administrator
Advanced User
*****
Offline Offline

Posts: 1285



WWW
« Reply #1 on: June 16, 2009, 07:36:19 PM »

Hi Nir,

Unlike QTP and other automation tools, AutoIt's Spy (AU3Info in the Scite editor Tools menu) does not drill down into the Web page's objects. It requires one to work with the objects based on information from the dev team about the ids or names of the objects, or use common sense and experience. Remember that AutoIt is a tool for automation developers; apart from really simple macros, it is not suitable - at least in my view - for record-replay automation (not that QTP is... either Smiley). So it requires a little sweat from us.

Here below is an example I've given in my presentation at the SIGIST meeting in last February.
The script takes as parameter the string to perform a Google search, and then iterates through the collection of links returned by the search engine.

Code
GeSHi (autoit):


;Demo 2: Web

#include <IE.au3>



$oIE = _IECreate ("http://www.google.com")

$oForm = _IEFormGetObjByName ($oIE, "f")

$oQuery = _IEFormElementGetObjByName ($oForm, "q")



_IEFormElementSetValue ($oQuery, $CmdLine[1])

_IEFormSubmit ($oForm)



$oLinks = _IELinkGetCollection ($oIE)

$iNumLinks = @extended

$strLinksList = ""

For $oLink In $oLinks

        $strLinksList = $strLinksList & $oLink.href & @CRLF

Next



MsgBox(0, "Google Search Link Info", $iNumLinks & " links found" & @CRLF & $strLinksList)



$oIE.Quit



 
Created by GeSHI 1.0.7.20

I hope this is illustrative enough to answer your query.
If you need more info, I advice you to use AutoIt's help - it's really very detailed and full of useful examples that can serve as basis for your customized scripts.
Logged

Best Regards,

Meir Bar-Tal
AdvancedQTP Chief Editor & Forums Administrator
niranjan deka
FRProject
Full User
*
Offline Offline

Posts: 226


« Reply #2 on: June 16, 2009, 11:57:27 PM »

Hi Meir,

It is always been nice to hear from you. The way you simplified the problem is great.You always ROCKS dude Smiley. I understand that any automation tool is not mere a record & playback(i guess if that happen, tester life is so easy;)).Here with this AutoIt tool also, this is hold true.As you have said that to be able to play with this tool, we need to have the object description from Dev or atleast the page source code access, in order to make the auto Id tool recognized that object and run a particlular method from the IE header file.I have go through the help files of Auto It and very much impressed with its details about its methods.I have already created some demo script from the idea i have got from your mentioned script.

But one question comes at top of my mind whether this tool has the special power like of QTP's getroproperty to retrive the real time values from a control, access a collection of a controls(childobject)(checkbox,radio,edit etc), reporting,checkpoints, global value declaration etc to make any automation framework really firm and flexible???

Anyway, thanks a lot for sharing the code and your concepts and i hope that not only me but newbies of autoit tool got some real picture.


Best Regards
Niranjan

Logged
Meir Bar-Tal
Administrator
Advanced User
*****
Offline Offline

Posts: 1285



WWW
« Reply #3 on: June 17, 2009, 12:11:23 AM »

whether this tool has the special power like of QTP's getroproperty to retrive the real time values from a control, access a collection of a controls(childobject)(checkbox,radio,edit etc), reporting,checkpoints, global value declaration etc to make any automation framework really firm and flexible???

The answers are yes, yes, yes, and even more... you can compile your scripts to exe files, include function libraries as in normal programming languages like C/C++, etc.

As to the runtime object properties values, you can gather from my example how this is done:

Code
GeSHi (autoit):
$oLink.href

 
Created by GeSHI 1.0.7.20

As the reference you get is to the actual DOM object, without wrapping interfaces, you can also do the same for any webelement with other properties like innertext, etc.
Logged

Best Regards,

Meir Bar-Tal
AdvancedQTP Chief Editor & Forums Administrator
Pages: [1]   Go Up
Print
Jump to: