Technical FAQ - Web Functional Testing
Dynamic Functions :
1. How to click a button element whose “id/name” value changes dynamically?
To click a button whose id / name changes dynamically, use fireEventOnElement function from built-in functions.
Syntax:
fireEventOnElement("tagName", "propertyName", "propertyValue", index,"actionName", "actionValue", "useRegExp")
Where
TagName=Tag name of the elements to be identified.select in your case
Propertypropertyname = Property to be matched.id/name of select element
propertyvalue = Property value to be matched. value of id/name
index = Occurrence of the elements.
actionName= select in your case
actionValue= Option value to be selected
regExpRequired =true/false.
Example:
fireEventOnElement("input","id","button_*",1,"click","NONE","true")
In the above, the HTML Input element whose id property starts with button_ will be obtained the click event will be fired over the element.
2. How to handle if the title of the application window changes dynamically ?
To handle the dynamically changing window title use the function setDynamicWindow() from built-in functions.
Syntax:
setDynamicWindow(parent_window_title,parent_window_index,frame_window_title or frame_window_name,value_of_frame_title or value_of_name,frame_window_index)
Where
parent_window_title is Title of the browser window
parent_window_index is occurence of the browser window with the same parent window title if any. Otherwise specify 1.
frame_window_title or frame_window_name is the property of the frame window name or title which is to be used for the window identitfication.
Value for the Title or Name specified in the 3rd argument.
frame_window_index is occurence of the similar frame window if any. Otherwise specify 1.
Example:
setDynamicWindow("Manageengine",1,"frame_window_title","payroll",1)
In the above the Browser window with title "Manageengine" will be searched and in the browser window frame window with the title "payroll" will be searched and set.
Checkpoints & Testcases :
Checkpoints & Testcases :
1. Does checkpoints needed to be added manually ?
In QEngine there is an option to add checkpoints / testcases. Hence there is no need to add checkpoints manually.
2. How to validate the property of a HTML element present in the webpage?
To validate the property of a HTML element in the webpage use checkpoints / Testcases.
Follow the below URL for inserting checkpoints in the script,
http://qengine.wiki.zoho.com/Inserting-Built---in-Functions.html
Note: Checkpoints can be inserted while recording only.
3. How to insert checkpoints QEngine ?
To insert checkpoints in QEngine follow the below steps,
- Start the recording of the application.
- Click on "Insert Checkpoints" and from the Check Points window, click on "Click to Proceed" link.
- Select the appropriate element in the web page.
- The element properties will be populated in the check point window.
- Click on the "Paste" button to add the checkpoint string in to the script.
4. How insert testcase to validate multiple property of a HTML element ?
To insert testcase to validate multiple property of a HTML element in QEngine follow the below steps,
- Start the recording of the application.
- Click on the "Insert Testcase" link and in the "Testcase Configuration" provide testcase id, description etc.,
- Select the ‘HTML-Check’ and select ‘element’ option in the "Testcase Configuration" window.
- Then select the element to be validated from the web page.
- The properties of the element will be listed in the "Testcase Configuration" window.
- Select / deselect the properties that need to be validated.
- Click on "Commit to List" to save the configuration.
- Click on "Apply" to save the testcase and insert the script function in the script.
Note: Testcase for HTML elements can be inserted only during recording.
5. How to validate the presence of a text in the webpage ?
To validate the presence of a text in the webpage use webCheckText() from built-in functions.
Syntax:
webCheckText("<Search_String>","<Prefix_String>","<Suffix_String>")
The whole webpage content will be searched for the given search string with given Prefix and Suffix String. If Prefix and Suffix String are configured as NONE then only search string will be searched.
Example:
webCheckText("QEngine","Manageengine","WebTest")
on Success it will return 0 , on Failure return 1.
6. How to validate the option selection in a select box ?
To validate whether particular option is selected or not in a select box use selectCheckInfo() function from built-in functions.
Syntax:
selectCheckInfo("<Element_ID>","<Property_To_Validate>","<Expected_Value_Of_The_Property>")
Example:
selectCheckInfo("countrycombo","selecteditems","India")
7. How to validate the multiple properties of a HTML element present in the webpage?
To validate multiple properties of the same element use testcase. In testcase all the properties of the same HTML element can be validated.
Follow the below link to insert testcases in a script,
http://qengine.wiki.zoho.com/Adding-Testcases.html
Note: Testcase for HTML elements can be inserted only during recording.
8. How to validate data addition in to the database table ?
To validate the database table entry use DBcheck option in testcase.
Follow the steps to insert DBcheck testcase :
- Click on the insert testcase and then select DBcheck.
- Configure the DB details and select the option 'Table Values'.
- Type the appropriate query to pull the data from the table.
- Click on the expected values with the condition equals. Give the number of rows and the column name which you want to search from the database.
- Apply the settings and run the test.
9. How to validate message text displayed in the alert popup ?
To validate the message text displayed in the popup, use staticCheckInfo function.
Example:
setAlertWindow("Microsoft Internet Explorer",2)
staticCheckInfo("Static", "value","<Message_displayed_in_the_popup>")
10. How to validate multiple HTML element exist in the same webpage ?
To validate multiple HTML elements present in the same webpage use testcase in QEngine. Inside a single testcase you can validate all the elements of the webpage.
To insert testcase for multiple elements in the testcase follow the below steps,
- Start the recording.
- Invoke the "Testcase Configuration" window through the ‘Insert Testcase’ link present above the script editor of QEngine window.
- Select the ‘HTML-Check’ from the type of testcase and ‘element’ option in the "Testcase Configuration" window.
- Now select the element to be validated from the webpage and click on the "Commit To List" to save the configuration.
- Click on the "New" button to create checkpoint for the next element.
- Similarly continue the Step 3 to Step 5 for the elements that needs to be validated in the webpage.
- After creating validation for all the element, click on "Apply" to save the testcase and insert the executeTest function in the script.
Note: HTML-Check Testcases can be created during recording. For creating DB-Check testcase recording is not necessary.
In the above testcase you can also insert DB-Check.
11. How to validate a HTML Table content in QEngine ?
To validate HTML Table content of the webpage, use testcase with "HTML-Table check" or "HTML Table Functions" in the built-in functions.
To validate HTML table by adding testcase follow the below steps,
- Start the recording
- Invoke the "Testcase Configuration" window through the ‘Insert Testcase’ link present above the script editor of QEngine window.
- Select the "HTML-check" option and "Table" option to add testcase for the HTML table.
- Select the appropriate cell of HTML Table from the webpage.
- The properties of table and the cell value of the selected cell will be added to the check properties of testcase, that will be validated during playaback.
- Click on "Add" button to add more checkpoints to the HTML table.
To validate HTML table using built-in functions,
- Click the ‘Insert Built-In Functions’ link.
- Select the “HTML Table Functions“ category, choose the appropriate function to check.
- Click the link ‘Click To Proceed’ and select the HTML table from your application page.
- Click on "Paste" button to add the checkpoints inside the script.
Note: To check the single property you can use check functions instead you can use testcase to check the multiple property.
12.How to validate the Database table properties inside the script ?
Using "Database Functions" of built-in functions you can validate the database table inside script.
Follow the below link for help on inserting "Database Functions",
http://qengine.wiki.zoho.com/Adding-Database-Functions.html
13. Does QEngine have any restriction on number of checkpoints / testcase can be added in a script ?
QEngine doesn’t have any restriction in number of checkpoints / testcases configurations for a single script. You can configure any number of checkpoints / testcases in a single script.
14.How to validate the elements present in a modal / modalless dialog ?
To validate the elements present in the modal / modalless dialog use the checkpoints / testcases as used in normal HTML Window.
Retrieving Values from Web Page :
1. How to retrieve data from the webpage to use inside the script ?
To retrieve data from a HTML Element use "HTML Get Functions" category functions.
To retrieve a value from a text field, use editGetInfo function from the built-in functions. To insert the above function follow the steps given below,
- Start the recording and browse to the page where the particular text field exists.
- Open the "Function Generator" by clicking the link "Insert Built-in functions".
- Select the "HTML Get Info" category and select the "editGetInfo" function from the functions combo.
- Click on the "Click to Proceed" link next to Function combo.
- From the Web Page Click on the text field from where the value needs to be retrieved.
- This will populate the Element ID and the various property that can be retrieved for the particular element.
- Choose the "Value" from the property combo to retrieve the value present in the text field.
- Click on the "Paste" button to paste the function in the script.
Example:
result=editGetInfo("textfield","value")
displayMessage(result)
To fetch any page text from your application you can use “webGetText” function.
Example:
result = webGetText("<Prefix String>","<Suffix String>")
displayMessage(result)
2. How to retrieve the option elements present in a select box ?
To retreieve the option elements of a select box, use selectGetInfo() from built-in functions.
To insert the above function inside script follow the below steps,
- Start the recording and browse to the page where the particular text field exists.
- Open the "Function Generator" by clicking the link "Insert Built-in functions".
- Select the "HTML Get Info" category and select the "editGetInfo" function from the functions combo.
- Click on the "Click to Proceed" link next to Function combo.
- From the Web Page Click on the text field from where the value needs to be retrieved.
- This will populate the Element ID and the various property that can be retrieved for the particular element.
- Choose the "Value" from the property combo to retrieve the value present in the text field.
- Click on the "Paste" button to paste the function in the script.
Example:
result = selectGetInfo("communication","itemcount")
displayMessage(result)
The result will give the number of option elements present in the select box communication.
3. How to get the number of links present in a webpage?
To get the number of links present in the webpage use getHTMLElementCount() from built-in functions.
Example:
result = getHTMLElementCount("A")
displayMessage(result)
4. How to get the number of rows/columns present in the HTML table?
To retrieve the row and column count of the HTML table use the below built-in functions.
getHTMLTableRowCount()-->to get the table row count
getHTMLTableColumnCount()-->to get the table column count.
Note: Above functions can be inserted while recording.
Map File :
1. How to change the ID given by the QEngine for my HTML button to an easily rememberable value?
The ID provided by QEngine in the script is to link the appropriate element property stored in the GUI Map file.
Example:
setText("username","John",2)
In the above "username" is the ID used by QEngine to retrieve the element properties of the text field stored in the GUI Map file. Sometimes the ID generated may not have meaningful representation of the field over which it is operating. Hence, if you wish to change the ID , then that needs to be changed in Map file and in the appropriate script line.
Follow the below instruction to modify the ID in QEngine,
- Right click over the appropriate script and open the map file by clicking on "Edit Script Map" menu.
- This will open the "GUI Map File Editor" window..
- Choose the element whose ID needs to be changed from the tree.
- The element properties will be shown in the right side window where ID will be in non editable textfield. Next to it there will be "Edit" Icon to allow editing of ID.
- Click on the Edit Icon and edit the ID to meaningful name.
- Then Click on "Update" to save the changes in the GUI Map File.
- In the script modify the changed ID in the appropriate script line.
You can change the ID in the Global Map file also.
Note: Make sure the changes made in the GUI Map file is reflected in the script also. Otherwise the particular script line will fail during playback.
1. How to change the ID given by the QEngine for my HTML button to an easily rememberable value?
The ID provided by QEngine in the script is to link the appropriate element property stored in the GUI Map file.
Example:
setText("username","John",2)
In the above "username" is the ID used by QEngine to retrieve the element properties of the text field stored in the GUI Map file. Sometimes the ID generated may not have meaningful representation of the field over which it is operating. Hence, if you wish to change the ID , then that needs to be changed in Map file and in the appropriate script line.
Follow the below instruction to modify the ID in QEngine,
- Right click over the appropriate script and open the map file by clicking on "Edit Script Map" menu.
- This will open the "GUI Map File Editor" window..
- Choose the element whose ID needs to be changed from the tree.
- The element properties will be shown in the right side window where ID will be in non editable textfield. Next to it there will be "Edit" Icon to allow editing of ID.
- Click on the Edit Icon and edit the ID to meaningful name.
- Then Click on "Update" to save the changes in the GUI Map File.
- In the script modify the changed ID in the appropriate script line.
You can change the ID in the Global Map file also.
Note: Make sure the changes made in the GUI Map file is reflected in the script also. Otherwise the particular script line will fail during playback.
Settings :
1. How to change the maximum wait time for the page to load completely under settings ?
To change the maximum wait time follow the below steps,
- Go to the 'Settings' option through link present in the suite tree.
- Choose "Replay Settings" and configure the value for "Maximum Wait time" as desired.
- Apply the changes and save the settings.
2.Does QEngine allow playback to ignore waittime recorded in the script ?
QEngine does allow the playback to ignore waittime recorded in the script function. Follow the below steps to configure the same,
- Go to Settings->Replay Settings.
- Choose "Fast - Run as fast as possible" under Replay Speed
- Save the settings.
This settings will take care of ignoring waittime recorded in the script.
3. How to playback the script recorded with the application running in one server host against another server host ?
To playback to script against different host use "Host-Port Settings" present under Suite settings. This will allow to configure the changed host and port details to play the script against different server host. Follow the below steps to configure the Host-Port settings,
- Click on the "Settings" link present in the Suite tree and select "Host Port Settings" tab in the settings page.
- Now check the checkbox for "Use Host Port" configuration and click on the "Host-Port Editor" link.
- In the "Host Port Configuration" screen, create new or use the default property file for configuring the change host and port details.
- The Property file will parse all the scripts in the suite and list all the host / port / protocol of the old server with empty field for configuring new changed host / port details.
- Configure the changed host / port details appropriately.
- Click on "Apply" to save the changes in a property file.
- From the settings window select configuration to use from the combo box and click on the "Apply" button of the settings page to save the settings.
This will change the host and port appropriately to play the script against the different server host.
4. How to close an unexpected popup window arise during playback ?
Unexpected popup is a alert type window pop's up only during playback session which doesn't came while recording. Hence the script may not contain the steps to close those window. To handle such scenario we can configure to close the unexpected popup in the settings.
In the settings, configure Exception handling -> Popup Exceptions and choose "Close & Continue Play" option to close the unexpected popup automatically.
5. Does QEngine scripts created for one language can be replayed against other language ?
QEngine does have the support to playback the script created against one language against other language.
Do the following configuration to achieve the above,
- Go to Settings. Select locale settings.
- Select the language in which you want to playback the script with the corresponding country.
- Click on 'I18N Editor' link present on the right hand side. It opens the locale configuration window. Provide the equavalent words (in the selected language) for the listed key words inside the editor.
- Save the settings and playback the script.