Forum Discussion

kandy1984's avatar
kandy1984
Contributor
9 years ago

New to scripting

Hi, im fairly new to scripting. All this while i have been doing keyword tests to test my desktop application. Would anyone fill me in with the benefits of scripting over keyword testing. I find that sometimes that my keyword tests get stuck when it doesnt find something. IF i start to test by scripting , will i have lesser hassle? i have chose VB script as the language. For a screen like this  (attached) how would i be able start by clicking on the link and going to the next screen and verifying that it has opened the correct screen which is Intervention Hub.

 

Thanks for helping.

 

Sudha

 

7 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

     
    I started with keyword and switched to scripting. main benifit I see is flexibility in scripting.
    Developement experince in many year ago helped me in transition.
    Even in scripting you will get stuck when TC can not find GUI object. will it be less hassle in scripting? no way!
    anything more flexible would more complex. But in long term you will benifit in scripting such as re-usebility in codes, building your own
    test frame-work and handing more complex errors...etc
    there are people(even in this forum) who uses both. you may try that as well.
    to start with scrpting try with simple test and build it up gradually.
    always think of re-userbility while scrpting

     

    first record script with small test you want to perform.

    then make script shorter and nice (readable )and add conditions..loops etc

    run it and debug...good luck!

    • Marsha_R's avatar
      Marsha_R
      Champion Level 3

      Along with the flexibility, I found that I could decrease the wait between events for the scripts so that the test ran in almost half the time when it was script instead of keyword tests.

       

      There's a Convert to Script feature that I found to be useful.  There are a few things you still have to fix in the syntax but for us it was very close.   Take a keyword test that you are familiar with and convert it to a script (you can keep both).  That way you will see the structure and be sure of what it is accomplishing.  You can also do that for your example.  If you are clear on how to write that in a keyword test, do it that way first and then convert it.  That will help you learn the scripting.

       

    • kandy1984's avatar
      kandy1984
      Contributor

      Thank you NisHera! Also I want to ask, for example, the function of clicking a button on a screen by uisng a script and by using keyword tests (recording the actual user's action), are they the same? Because i need to check whether or not the button works when clicked - this is user interface testing actually. Which approach is recommended? 

       

      Thanks once again.

       

       

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Recording is actually not recommended at all.  The user actions will be recorded by location on the screen and that is not very accurate.  

         

        You can click on a button from either a keyword test or a script by using the ClickButton function.  

  • Thanks u everyone who replied to question. Now im much more clearer.