Micro Focus QTP (UFT) Forums

Full Version: I can't displaying all the pages name in the .txt file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using web application . I want to display my all the pages name . But i am not getting and some messge is displaying. error message is
"Type mismatch Line (21): "ln=total_no_link(i).getRoProperty("name")".
Why this error is displaying .
I am displying my code .


Code:
Dim Total_no_link
Dim clink ,rc,mysmgbox
Dim ln
Set fileSysObject=createobject("Scripting.FileSystemObject")
Set linksFileName=fileSysObject.opentextfile("D:\a1.txt",2,true)
Set cLink =description.Create()
cLink("html").value="A"
Browser("Login Page").Page("Login Page").WebList("select").Select "SQL2005"
Browser("Login Page").Page("Login Page").WebList("select_2").Select "VIL0910SQL2005"
Browser("Login Page").Page("Login Page").WebEdit("txtUserID").Set "nj"
Browser("Login Page").Page("Login Page").WebEdit("WebEdit").SetSecure "4a89374a064976d6f9f1"
Browser("Login Page").Page("Login Page").WebList("select_3").Select "WHFD00"
Browser("Login Page").Page("Login Page").WebList("select_4").Select "WHFD00"
Browser("Login Page").Page("Login Page").WebList("select_5").Select "FOOD"
Browser("Login Page").Page("Login Page").WebButton("Enter").Click
Browser("Login Page").Page("Main Menu Page").Link("General Master").Click
Set rc=Browser("Login Page").Page("Main Menu Page").ChildObjects(cLink)
Total_no_link=rc.count()
For i=0 to  total_no_link-1
  [b] ln=total_no_link(i).getRoProperty("name")[/b]
    linksFileName.writeline(link_name)
Next
linksFileName.close
Set fileSysObject=nothing


'mymsgbox=msgbox(total_no_link)
Browser("General Master").Page("General Master").WebButton("Exit").Click
Browser("Login Page").Page("Main Menu Page_2").Link("Exit").Click
Browser("Login Page").Page("Login Page_2").Sync
Browser("Login Page").Close


PLese tell me why this messge is displaying ..

Thanks in Advance
Is this a interview question ?. If not, please post it under the appropriate forum category.