Label: scripting

Content with label scripting in Knowledge Base
Related Labels: overload, aut, path, object_property, share, no_matching_overload, message, database, typeerror, tcl, perl, enhance, properties, auto-completion, load, builtin, rubygem, error, javascript, more »

Page: Accessing Databases From Perl Test Scripts
Windows The "perl" folder in Squish binary packages for Windows contains a minimal Perl installation which lacks PPM (Perl Package Manager) for downloading and installing new modules, as well as modules for accessing database (DBI, specific DBD modules, etc ...
Other labels: perl, database
Page: Article - Logging object properties
following {{logobj()}} functions can be used to output all properties and property values of an object to the {{Test Results}} view and/or the log. Python: def main(): # startApplication(...) logobj(waitForObject(" ")); def logobj(obj): properties = object.properties(obj) keys = properties.keys ...
Other labels: properties
Page: Article - Modularizing your recorded scripts for reuse (refactoring)
Overview Typically a group of steps performed in one recorded test script are steps that one wants to use again in other test cases. There are several methods to turn recorded commands into reusable script pieces. Several possibilities exist: Variant 1 ...
Other labels: function, refactor, optimize, enhance, robust, share, improve
Page: Can I use Python modules?
Overview Yes, you can load Python modules in the standard way. For example: import os import sys import time Related Information Article Using Squish functions in your own Python modules or packages
Other labels: python, load, modules
Page: Error message "No matching ... overload found Following overloads are available"
Python makes a distinction between numbers and strings, so if you have a number as a string (e.g., "562"), and want to access the value as a number, you must explicitly convert it. Normally this is easily done using the standard Python syntax {{i = int ...
Other labels: builtin, overload, typeerror, python, module, str, message, __builtin__
Page: Functions stop working after a Perl "use Shell" statement
Symptom If you put this Perl statement in your test scripts it will cause problems. use Shell; Any calls to Squish functions such as {{waitForObject()}} that follow this statement will cause script errors such as: Can't exec waitForObject: No such file or directory Explanation By default the Perl ...
Other labels: perl
Page: How do I get the application path?
get the path to the application in a test script the most technically accurate approach is to invoke {{squishrunner}} with the {{\\info}} {{applications}} parameters and to parse the resulting output to find the path relevant to the application. Here are some examples: With {{squishrunner}} and {{squishserver}} running on the same computer: squishrunner ...
Other labels: path, aut, tcl, pathname, perl, python, javascript
Page: How do object properties nest?
can be useful to know how to nest one object name inside another Real (multiproperty) object names are of this form: If a property's value is another object name, then that name can simply be copied, either as a real name or as a symbolic name. Nesting ...
Other labels: naming, nesting, objects, object_property, object_properties
Page: Leverage the improved IDE integration of the Script-Based Object Map
name suggests the ScriptBased Object Map is much more tightly coupled to the scripting languages than the old TextBased Object Map. During development of the ScriptBased Object Map we spent a lot of time on improving the user experience when writing ...
Other labels: python, ide, javascript, perl, tcl, ruby, objectmap, auto-completion
Page: Ruby script execution through external interpreter
Overview Some test scenarios require to execute Ruby code through an external Ruby installation, for example if it makes use of a Gem that can't be installed using Squish's own Ruby installation. Prerequisite Install Ruby side by side with Squish ...
Other labels: ruby, rubygem, gem, interpreter