Micro Focus QTP (UFT) Forums
descriptive programing to click the link on web - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: descriptive programing to click the link on web (/Thread-descriptive-programing-to-click-the-link-on-web)



descriptive programing to click the link on web - devanggoel - 02-22-2010

can any one tell me the descriptive programing for clicking the link on web....like open the yahoo.com and click on the signin link.


RE: descriptive programing - Tarik Sheth - 02-22-2010

Try following

Code:
Dim obj_ChkDesc

Set obj_ChkDesc=Description.Create
obj_ChkDesc(“Class Name”).value = “Link”
Obj_ChkDesc("name").value="Log in"

Browser().page().link(obj_ChkDesc).click

Also you can use following to highlight the link

Code:
Browser().page().link(obj_ChkDesc).Highlight



RE: descriptive programing - bfakruddin - 02-23-2010

Code:
systemutil.run "www.yahoo.com"

browser("name:=Yahoo").activate

browser("name:=Yahoo").page("name:=Yahoo_Page").weblink("outerhtml:=Inbox").click
or
Code:
dim des

set des=description.create

des("micclass").value="Link"

set cnt=browser("yahoo").page("yahoo_page").childobject(des)

msgbox cnt.count

for i=0 to cnt.count-1

     val_name=cnt(i).getroproperty("outerhtml")

     if (val_name=Inbox)  then

         cnt(i).click

     end if

Next

set des=nothing



RE: descriptive programingghhhhhhhf - Saket - 02-25-2010

Hi D.Baba-
Please wrap your codes in proper tags, which makes your post more readable. I did it for you this time Smile
@devanggoel - always put your thread title that is relevant to the query not a generalised one, this way we can identify the queries better while searching for it. by the way what do mean by 'programingghhhhhhhf'


RE: descriptive programingghhhhhhhf - prasadworld321 - 02-26-2010

------------------------------------------------------------------------------------
1.Descriptive programme for FR login.
------------------------------------------------------------------------------------
Code:
InvokeApplication"E:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
dialog("text:=Login").winedit("window id:=3001").Set"test"
dialog("text:=Login").winedit("window id:=2000").Set"mercury"
dialog("text:=Login").winbutton("window id:=1").Click

Descriptive Programming for Gmail Login Page
Code:
SystemUtil.Run "iexplore.exe","www.gmail.com"
Browser("name:=Gmail.*").Page("title:=Gmail.*").WebEdit("name:=Email").Set "abc"
Browser("name:=Gmail.*").Page("title:=Gmail.*").WebEdit("name:=Passwd").SetSecure "xyz"
Browser("name:=Gmail.*").Page("title:=Gmail.*").WebButton("name:=Sign in").Click