12-30-2008, 01:45 PM
Hi Ankur,
I have to do this...
' Action1 (Upload Property)
'---------------------------------------------------------------
Here I want to use the Property id as the return value for this Action1 so that I can use it in the Action2 to find out the property, and do some task with that property.
---------------------------------------------------------------
'Action2 (Publish Property)
--------------------
Also need to know If I can optimize some qtp script here.
I have to do this...
' Action1 (Upload Property)
Code:
SystemUtil.Run "iexplore", "http://MyTestingSite.net"
Browser("MyTestingSite").Page("MyTestingSite").Image("MyTestingSite").Click
Browser("MyTestingSite").Page("MyTestingSite_2").Link("ESTATE AGENTS HOME").Click
Browser("MyTestingSite").Page("MyTestingSite_3").WebEdit("UcAgentLogin1$txtAgentName").Set "UserName"
Browser("MyTestingSite").Page("MyTestingSite_3").WebEdit("UcAgentLogin1$txtPassword").Set "Password"
Browser("MyTestingSite").Page("MyTestingSite_3").Image("Login").Click 34,11
Browser("MyTestingSite").Page("MyTestingSite_4").Link("add a new property").Click
Randomize()
propertyID="Property_"&int(100*rnd())
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$txtPropert").Set propertyID
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$txtAddress").Set "test"
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$txtAddress_2").Set "test"
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$txtTownToB").Set "test"
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$txtCountyT").Set "test"
Browser("MyTestingSite").Page("MyTestingSite_5").WebList("UcNewPropertyToBuy1$drpRegionT").Select "London"
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$txtPostCod").Set "BR 123"
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$txtPropert_2").Set "Property Summary"
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$txtDisplay").Set "Display Address"
Browser("MyTestingSite").Page("MyTestingSite_5").WebFile("UcNewPropertyToBuy1$Upload6").Set "file://path/image.jpg"
Browser("MyTestingSite").Page("MyTestingSite_5").WebEdit("UcNewPropertyToBuy1$MainImageT").Set "Image title"
Browser("MyTestingSite").Page("MyTestingSite_5").WebCheckBox("UcNewPropertyToBuy1$ckbSubmit").Set "ON"
Browser("MyTestingSite").Page("MyTestingSite_5").Image("UcNewPropertyToBuy1$btnSaveToB").Click 68,12
Browser("MyTestingSite").Page("MyTestingSite_6").Check CheckPoint("MyTestingSite")
Browser("MyTestingSite").Page("MyTestingSite_6").Link("Return home").Click
Here I want to use the Property id as the return value for this Action1 so that I can use it in the Action2 to find out the property, and do some task with that property.
---------------------------------------------------------------
'Action2 (Publish Property)
Code:
RunAction "Copy of UploadProperty", oneIteration
SystemUtil.Run "iexplore","http://MyTestingSite.net/admin"
Browser("MyTestingSite").Page("MyTestingSite").WebEdit("txtusername").Set "UserName"
Browser("MyTestingSite").Page("MyTestingSite").WebEdit("txtpassword").Set "Password"
Browser("MyTestingSite").Page("MyTestingSiteS").WebButton("Login").Click
Browser("MyTestingSite").Page("MyTestingSite_2").Image("properties").Click
wait (2)
Dim row,i,strProperty,lnkImg
'+++++"I want here the return value of action1 i.e. the ProprtyToBePublish"++++++
ProprtyToBePublish = ??????????????? 'return value from action1
'++++"I want here the return value of action1 i.e. the ProprtyToBePublish"++++
msgbox ProprtyToBePublish
row = Browser("MyTestingSite").Page("MyTestingSite_2").Frame("Frame").WebTable("1").GetRowWithCellText(ProprtyToBePublish)
msgbox row
set lnkImg=Browser("MyTestingSite").Page("MyTestingSite_2").Frame("Frame").WebTable("1").ChildItem(row,5,"WebElement",0)
lnkImg.Click
Browser("MyTestingSite").Page("MyTestingSite").Frame("Frame_2").WebCheckBox("chkIsPublished").Set "ON"
Browser("MyTestingSite").Page("MyTestingSite").Frame("Frame_2").Link("Save Property").Click
Also need to know If I can optimize some qtp script here.