cancel
Showing results for 
Search instead for 
Did you mean: 

Barking up the right tree?

Highlighted
Super Contributor

Barking up the right tree?

I am doing proof of concept automation for my team in TestComplete. I have 2 different communities, toolsmithies like me who will write reusable actions, and QA generalists who want nothing to do with object recognition of action recording/creating. They want to make keyword tests out of stuff that other people like me write.

 

I want to have a project for on screen object recognition whether in code or name map and another for reusable actions (login, add record...). I want these actions and objects to be available to the QA generalist. Is this an appropriate application for extensions? I have not dealt in extensions before. But it seems that I can write what I want then distribute. Please let me know if I am misunderstanding.

 

Thanks

1 REPLY 1
Highlighted
Contributor

Re: Barking up the right tree?

It sounds like what i m working on right now, which is creating Keyword Operation Extension. Adding a group to the keyword Operation panel , and then adding actual keywords test. This allows the user to create their own plans based on the actions available to them. They do not need to know the underlying scripts.

 

Here' the description.xml

 

<ScriptExtensionGroup Name="The Extension's Group Name">
    <Category Name="The Catagory Name">
        <ScriptExtension Name="Data Request Extension" Author="Hoang Van Vo" Version="" HomePage="" >
            <Script Name="myScriptName.vbs" InitRoutine="" FinalRoutine="">
			<KDTOperation Name="The Name of the keyword test" Category="The Keyword Operation Group Name" Icon="" OperationType="">
				<Data>
					<Field Name="field1" />
					<Field Name="field2" />
					<Field Name="field3" />
				</Data>
				<Events>
					<Event Name="OnExecute" Routine="MYTEST_OnExecute" />
					<Event Name="OnCreate" Routine="MYTEST_OnCreate"  />
					<Event Name="OnSetup" Routine="MYTEST_OnSetup" />
				</Events>
				<Columns>
					<Column Name="Item" Value="Item's Column Content" />
					<Column Name="Operation" Value="Operatio's column Content" />
					<Column Name="Description" Value="Description's Column Content" />
					<Column Name="Value" GetValue="MYTEST_GETVALUe" />			
				</Columns>
			</KDTOperation>
		</Script>
            <Description>The description of the script's group</Description>
        </ScriptExtension>
    </Category>
</ScriptExtensionGroup>

<ScriptExtensionGroup Name="The Extension's Group Name">

I am not sure if this value shows up anywhere within the application  - I have not check and if someone here can answer great.

 

    <Category Name="The Catagory Name">

This is the catagory name you see inside the script extension installation window (file -> Script extension install), the group heading name

 

<ScriptExtension Name="Enable/Disable Scripts by Groups" 

The scripts group name, allows enable/disable of all scripts belong to the group.

 

  <Script Name="myScriptName.vbs" 

The vbs filename (i use vbscript). this file has to exist in the same folder as the description.xml, i have not try pathing to a different folder.

 

<KDTOperation Name="The Name of the keyword test" Category="The Keyword Operation Group Name" Icon="" OperationType="">

The operation name, the group this operation belong too, its icon image file, and if it can be group .

 

with the above active in teh script install in my keyword operation window it will look like this:

 

The Keyword Operation Group Name

            The Name of the keyword test

 

 

the <Field Name="field1" />

works with the events, and the actual funtions/routine would be in a different file(your script files).

 

function MYTEST_OnSetup(data)

  data.field1=value

end function

 

 

 

function MYTEST_OnExecute(data)
   ...//your codes
end function

function MYTEST_OnCreate(data)
...//your code
end function

function MYTEST_OnSetup(Data)
...//your codes
end function

function MYTEST_GETVALUE(data)
...//your code
MYTEST_GETVALUE=MyreturnValue
end function

 

If you need user input create your custom forms and export the file , they all have to exist in the same folder 

To access the form, say when you want them to select which button to press on a toolbar , but instead of creating a button keyword test for each button, you create a 'click toolbar button' keyword, and have the user select which they want to click.

 

UserForms.FormName

 

to access the fields in teh form like textboxes.

 

data.field1=UserForms.FormName.txtName.Text

this will assign the field1 variable a text value inside your form. 

 

The type of event aboves:

OnCreate - when you drag the operation into the keyword test (I believe this also when you double click to change, but i have not gotten tot hat area yet since i m still tryign to write as much operation as possible)

OnSetup - when the user finish the form, this is where you assign teh values inside the form back to the fields

OnExecute - call when the user runs the script.

 

There's one downside to this, the coding of the routine's script is done in an editor, you can probably do it in TC, but there's a lack of code completion.

 

what i end up doing is


function MYTEST_OnExecute(data)

 

if not Runner.CallMethod("TCScriptFileName.Methods",data) then

   log.error "Unable to complete Execution"

end if

end function

 

this way, the TCScriptFileName will contain the 'Methods' function, and will accept data which contains data.field1, data.field2,etc..

 

and with it being a TCScript files inside test compelte, you can edit it easier, and even test it out via test complete's to make sure that the coding runs without any which.

 

I hope this help with getting your project started

 

 

New Here?
Join us and watch the welcome video:
Building with the Collaborator API

Help Documenation
The Collaborator API is a JSON-RPC API that lets you integrate with Collaborator 9.0 and above. For more information about how the API works, check out the API description here:


Sample Plugins
For an example of an add-in that uses the API, take a look at the Microsoft Word Add-in for Collaborator:


We list all the great plugins our network has already built on this page on the SmartBear website.

Labels