Ask a Question

Script Extenson: All Parameters are Undefined

Occasional Contributor

Script Extenson: All Parameters are Undefined

I'm creating my first script extension and I'm running into a serious wall with the Parameters object.


I have this code: 

function AdvWait_OnCreate(Data, Parameters)
  Parameters.URL = "";

function AdvWait_OnExecute(Data, Parameters)

I would expect this to result in a log event with the title "", but the title is blank. If I try to put Parameters.URL in the Additional Info section of the log, it prints as "undefined". The code otherwise seems to work, but it's no use if I can't access or use my parameters.


If it helps, this is my description file:

    <Category Name="Keyword Test Operations">
        <ScriptExtension Name="Advanced Wait" Version="0.1">
          <Description>Pauses the script for a set time until the page loads.</Description>
            <Script Name="AdvWait.js">    <!-- Specify the script file name here -->
                <KDTOperation Name="Advanced Wait" Category="Test Actions">
                        <Parameter Name="URL"/>
                        <Column Name="Item" Value="Advanced Wait" />
                        <Column Name="Value" Editable="True" EditorType="Parameters" />
                        <Event Name="OnCreate" Routine="AdvWait_OnCreate" />
                        <Event Name="OnExecute" Routine="AdvWait_OnExecute" />

Both have been cut down significantly, but this problem persists whether I have one parameter or a dozen. Any help would be appreciated.


OK!  I got it!

So... in your OnExecute event handler, you need to change the code to the following.

function AdvWait_OnExecute(Data, URL)

As per the help, for this handler, you don't pass in the Parameters object, you pass in the actual parameters themselves in the order in which they are defined in the Description.xml file (see


So... you probably don't need the custom form as discussed earlier... just change this code.


Also... you're doing a Log.Event.  So, you need to make sure that under Tools -> Current Project Properties -> Playback you have the "Store last ___ events" set to 0.  Events are suppressed unless an error or warning is logged in which case it will write out the number of events set in that value.  If it's set to 0, all events get logged.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Occasional Contributor


Showing results for 
Search instead for 
Did you mean: