Results 1 to 2 of 2

Thread: Hi, can I parametrize this?

  1. #1
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    Hi, can I parametrize this?

    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")

    Regards,
    Brijesh Jain
    ---------------------------------------------------------
    Connect with me on Skype: jainbrijesh
    Google Plus : jainbrijeshji

  2. #2
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    Re: Hi, can I parametrize this?

    1. A Function Call with first Parameter an Array for all the Editiable Controls, common in all the test scenarios.

    2. Last Parameter as the Checkpoint Values.


    Function F_CTestCase(Array_Ed_Param, blnCheckPtn)

    Browser(a).Page(b).Frame(c).WebEdit(Ed1).Set Array_Ed_Param(0)
    " """"
    "
    Browser(a).Page(b).Frame(c).WebButton(btn1).click

    ' Checkpoint
    if blnCheckPtn <> "" then
    'Checkpoint Validation using RO Property
    end if
    End Function



    Regards,
    Nawab


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact