|
Can I set or get variable values globally from one script to another ?
Can I change the server name and port no in the recorded scripts during playback ?
Can I define my own custom functions and call the same from webscript ?
How do I check the values of a html table with that of a database table column ?
Want to create new environment variables for your test suite ?
|
Description |
You can define variables as per your choice whose value can be substituted in the test case definition. |
|
Availability |
Web Functional Testing |
|
Solution |
Choose the Data Configuration option from the script editor toolbar options to select the Variables option and configure the variables as per requirement. Refer Configuring Environment Variables for details. |
Can I define my own custom functions and call the same from webscript ?
|
Description |
I want to define my own functions using the def statement and call the same from webscript. |
|
Availability |
Web Functional Testing |
|
Solution |
1. Create a python script <fileName>.py and save it under <QEngine Home>/jars/ directory, and define your functions in that file. Instead of saving the .py file under <QEngine_Home>/jars directory, you can also edit the file setcommonenv.bat/sh file and provide path to the ".py" file for the variable PY_PATH. 2. In your script, you can import the .py file using from "<filename>" import * This must be done in the first line of the script. 3. Now, you can use the functions defined in the .py file. |
How do I check the values of a html table with that of a database table column ?
|
Description |
I want to check the values of html table column (color) with the database table column(color). |
|
Availability |
Web Functional Testing |
|
Solution |
Can be achieved using the sample code given below: result=getAllHTMLTableCells("Table1") initDB("1.1") result1=getDBValues("select color from diamonds") rowcnt=len(result1) check="" for i in range(0,rowcnt): dbVal=str(result1[i][0]) tableVal=str(result[i+1][1]) if dbVal!=tableVal: check="false" break; if check=="false": reportStatus("dbcheck",1,"DB and Table Values Check") else: reportStatus("dbcheck",0,"DB and Table Values Check") In the above example, result is the array values retrieved from html table and result1 is the array values retrieved from database by executing a query. In the for loop, the value at a specified index of the array is checked and the variable is initialized to "false", if the check fails. The report status is reported using the reportStatus() to view the status of the test in the reports. |
Can I use any database to check or get db values ?
|
Description |
Can I use any database such as MS SQL Server or Sybase to check or get the db values using Database Checkpoint option or Data Configuration->Database option. |
|
Availability |
Web Functional Testing |
|
Solution |
Yes, QEngine supports any JDBC compliant database. But, you need to set the appropriate classpath for the database driver by editing the DB_CLASSPATH variable in setcommonenv.bat/.sh file in <QEngine_Home> directory. Also, you need to add the new database by clicking the "Configure" button next to the Database field in "Insert Testcase->Database Checkpoint" screen or in "Control->Data Configuration->Database" screen. |
Can I use python modules in the script? If yes, how?
|
Description |
Want to use python modules in webscript. |
|
Availability |
Web Functional Testing |
|
Solution |
To use python modules in webscript, download the zip file from the following url: http://forums.adventnet.com/download.php?id=386 Extract the downloaded file under <QEngine_Home> directory. Edit the file setcommonenv.bat/sh file and provide path to "<Python_installation directory>/lib folder (where the python modules are placed) for the variable PY_PATH. Then, use the import statement to import the required python modules as import "<python_module_name>" which should be the first line in the script. Now, you can include your python modules. |
Can I call one script from another or control the order of execution of the webscripts that need to be replayed ?
|
Description |
Assume, you have a login script and you have to call this login script from script1 wherein the user first logs in and then performs the operations recorded in script1. |
|
Availability |
Web Functional Testing |
|
Solution |
You can use the callScript function to call one script from another script. For more details, refer to Chaining the Scripts. |
Error in opening the database connection ?
|
Description |
The tool is unable to open the database connection. |
|
Cause |
This problem is due to missing classpath for the database driver. To configure the classpath for the database driver, you need to edit the appropriate bat/sh file and configure the classpath. |
|
Solution |
In <QEngine_HOME>/setcommonenv.bat/.sh - Edit the DB_CLASSPATH variable as: DB_CLASSPATH=%SERVER_HOME%/jars/mysql_connector.jar where you need to give the appropriate path of the database driver such as mysql or oracle driver which you are using for your application testing. |
Can I set or get variable values globally from one script to another ?
|
Description |
I want to set or get values in a global variable from any of the recorded scripts or from one script to another while using the callScript(). |
|
Availability |
Web Functional Testing |
|
Solution |
You can use the setGlobal() and getGlobal() functions. You can refer to the usage of the functions in the following document. |
Is there a way of un-merging the maps ?
|
Description |
I have merged the local map files and created a global map file. Is there a way to restore the local map file. |
|
Availability |
Web Functional Testing |
|
Solution |
You can restore the local map file by renaming the <Your Map>.map.merged to <Your Map>.map. After adding useLocalMapFile to the script, it be can run from local map file. |
Can I change the server name and port no in the recorded scripts during playback ?
|
Description |
In the recorded scripts (multiple scripts in a suite), need to change the host name and port no to a new name and port in one shot. For example, clickImage("http://test1-server:8080/co/images/sports.gif",2) as clickImage("http://test2-server:6060/co/images/sports.gif",2). |
|
Availability |
Web Functional Testing |
|
Solution |
Yes, at one shot you can change both the server name and the port no during playback using the Host-Port Settings Configuration screen in the Play Settings page. The changes will be dynamically done during playback and will not be reflected in the recorded script. Please refer to the Play Settings page for details. You need to give both the existing server name and port no as a name-value pair and the new host name and new port no as a name-value pair. To change only the host name, specify the existing server name and port no as a name-value pair and the new host name and existing port no (since there is no change in the port no). |
|