Hello frnd, i have the same code to run for 3 different type of data. Ya, i can easily parametrize it using a table parameter. But what is the problem, i have to see the result of 3 different checkpoint for these there types of data? so, how i can parametrize it, so that qtp execute respective text checkpoint to see the expected message in these 3 different test cases?
ok, i am posting the script also..
' test case1:- property image from my computer
browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper").select "0" browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper_2").select "0" browser("index").page("dummy-property editing").webedit("ctl00$cphcentralitem$addproper").set "property image from my computer" browser("index").page("dummy-property editing").webfile("ctl00$cphcentralitem$addproper").set "c:\program files\mercury interactive\quicktest professional\tests\imageuploading\testing.jpg" browser("index").page("dummy-property editing").webbutton("upload").click
' test case2:-property image from external source
browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper").select "0" browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper_2").select "1" browser("index").page("dummy-property editing").webedit("ctl00$cphcentralitem$addproper").set "property image from external source" browser("index").page("dummy-property editing").webedit("ctl00$cphcentralitem$addproper_2").set "http://online.cypressgmac.com/shared/fs/0131/013100001/richland_real_estate.jpg" browser("index").page("dummy-property editing").webbutton("upload").click
' test case3:- corrupted property image
browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper").select "0" browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper_2").select "0" browser("index").page("dummy-property editing").webedit("ctl00$cphcentralitem$addproper").set "corrupted property image from my computer" browser("index").page("dummy-property editing").webfile("ctl00$cphcentralitem$addproper").set "c:\program files\mercury interactive\quicktest professional\tests\imageuploading\blue hills for testing corrupted.jpg" browser("index").page("dummy-property editing").webbutton("upload").click browser("index").page("dummy-property editing").check checkpoint("corrupted image")
' test case4:- wrong link of property on web
browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper").select "0" browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper_2").select "1" browser("index").page("dummy-property editing").webedit("ctl00$cphcentralitem$addproper").set "property image from external source" browser("index").page("dummy-property editing").webedit("ctl00$cphcentralitem$addproper_2").set "http://online.cypressgmac.com/shared/fs/0131/013100001/real_estate.jpg" browser("index").page("dummy-property editing").webbutton("upload").click browser("index").page("dummy-property editing").check checkpoint("wrong link of property on web")
' test case5:- location provided is not of an image but is an document text file
browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper").select "0" browser("index").page("dummy-property editing").webradiogroup("ctl00$cphcentralitem$addproper_2").select "0" browser("index").page("dummy-property editing").webedit("ctl00$cphcentralitem$addproper").set "property image from my computer" browser("index").page("dummy-property editing").webfile("ctl00$cphcentralitem$addproper").set "c:\program files\mercury interactive\quicktest professional\tests\imageuploading\test.txt" browser("index").page("dummy-property editing").webbutton("upload").click browser("index").page("dummy-property editing").check checkpoint("corrupted image")