SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    May 2007
    Location
    San Diego, CA
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Dynamically assigning testcase names

    I have an input file which I would like to include the testcase name in, then dynamically create the testcase name based on an input column. Is this possible?

  2. #2
    Senior Member
    Join Date
    Jan 2002
    Location
    Des Moines, Iowa
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically assigning testcase names

    Yep, You can use the @ operator in front of a variable and it will execute the variable as a test case or method.

    Here is an example of code that allows you to actually write your test cases in Excel or whatever then read them into silk to execute
    <font class="small">Code:</font><hr /><pre>
    [-] for each iTestCase in liTestCaseID
    [-] do
    [ ] Env.Drop (rKeyword.Silkhdbc)
    [ ] Env.Create (rKeyword.Silkhdbc)
    [ ] //Get the step
    [ ] lrTestStep = GetTestData (iTestCase)
    [-] for each rTestStep in lrTestStep
    [ ] //Perform that step
    [ ]
    [ ] rKeyword.bValid = false
    [ ] bMoreFields = true
    [ ] i = 1
    [ ] laArguments = ClearList (laArguments)
    [ ] sArgs = rTestStep.sArgs
    [ ] iLen = Len(sArgs)
    [ ] iField = 1
    [-] for i = 1 to iLen
    [-] if Substr (sArgs, i, 1) == ","
    [ ] iField++
    [-] for i = 1 to iField
    [ ] aField = GetField (sArgs, ",", i)
    [ ] listappend (laArguments, trim(aField))
    [-] if rTestStep.sArgs != ""
    [ ] @(rTestStep.sScreen).@(rTestStep.sMethod) (rKeyword, laArguments)
    [ ] //11110
    [-] else
    [ ] @(rTestStep.sScreen).@(rTestStep.sMethod) (rKeyword)
    [-] if ! rKeyword.bValid //If a step failed get out of the test case.
    [ ] goto exitTestCase
    [-] except
    [-] if ExceptNum() == E_VERIFY
    [ ] MessageLog.LogMessage (rKeyword.Silkhdbc, "Error", ExceptData())
    [-] else
    [ ] MessageLog.LogMessage(rKeyword.Silkhdbc, "Error", "Test Case {rTestStep.sScreen}.{rTestStep.sMethod} Unexpectedly Failed. Call Stack: {GetCallStack (ExceptCalls ())}. Here is the exception data., {ExceptData ()}")
    [ ] DoGetOut()
    [-] if ! rKeyword.bValid
    [ ] //Print ("{rTestStep.sScreen}, {rTestStep.sMethod}, {bValid}")
    [-] if bStopPlan
    [ ] goto exitPlan
    [ ] exitTestCase:
    [ ] UpdateTestCase(rKeyword.Silkhdbc, iTestCase, rKeyword.bValid, sTestPlan)
    [ ] DoGetOut()
    [-] if ! rKeyword.bValid
    [ ] //Print ("{rTestStep.sScreen}, {rTestStep.sMethod}, {bValid}")
    [-] if bStopPlan
    [ ] goto exitPlan
    [ ]
    [ ] exitPlan:

    </pre><hr />

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:49 PM.

Copyright BetaSoft Inc.