<rss version="2.0"
 	 xmlns:dc="http://purl.org/dc/elements/1.1/"
 	 xmlns:atom="http://www.w3.org/2005/Atom">

	<channel>
		<title>QEngine Blog</title>
		<atom:link href="http://blogs.qengine.com/feed" rel="self" type="application/rss+xml"/>
		<link>http://blogs.qengine.com</link>
		<description><![CDATA[QEngine Team Blogs]]></description>
		<pubDate>Thu, 29 Jul 2010 18:10:34 -0700</pubDate>

		<item>
			<title>Handling Browser Cache &amp;amp; Cookies in Functional Testing</title>
			<link>http://blogs.qengine.com/2009/12/22/handling-browser-cache-cookies-in-functional-testing</link>
			<dc:creator>Raghavan</dc:creator>
			<description><![CDATA[<p>In any automation certain errors might happen due to environmental issues. Such issues are very hard to debug as there may not be a trace available to handle such errors.</p><p>In this blog i will be introducing few environmental problems with appropriate solution available in QEngine,</p><p></p><ol><li><b>Browser Cache</b>:<br>While loading a requested page browser may load the page from the browser cache instead of requesting it from the server. This may cause any functionality breakage, due to which the test cases may result in failure.&nbsp;<br><br>In the above case, if the requested page is got from the server, the above failure mat not have happened.&nbsp;<br><br><b>Solution</b>:<br>In QEngine there is a setting available to clear cache before starting the playback.<br>To configure the above setting goto, <b>Suite-&gt;Settings-&gt;Replay Settings </b>and enable the checkbox for <b>Clear browser cache before starting the playback</b>.<br><br>With the above settings we can&nbsp;minimize&nbsp;the error occurring due to browser cache.<br><br></li><li><b>Cookies<span class="Apple-style-span" style="font-weight: normal;">:<br>Cookies are the state identifiers sent with the request to the server from the browser. Browsers will store the cookies of the previous visit to use it next time when the server is requested. If there is any cookie of the expired server session present in the browser, then it will cause the wrong page to load in the browser. This may cause any functionality error, thus the test case will result in failure.<br><br>In the above case, if the cookies were not present for the server domain, then these problem may not happen.<br><br><b>Solution</b>:<br>In QEngine there is a setting available to clear cookies for the configured domain from the browser.<br>To configure the above setting goto,<b>Suite-&gt;Settings-&gt;Replay Settings </b>and enable the checkbox for <b>Clear browser cookies for</b>&nbsp;and configure the server domain name in the textbox.<br><br>With the above setting the we can minimize the error occuring due to cookies.<br><br></span></b></li></ol><div>Thus few environment issues can be minimized using QEngine.</div><div><br></div><div>Raghavan</div><p></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/12/22/handling-browser-cache-cookies-in-functional-testing</guid>
			<pubDate>Tue, 22 Dec 2009 01:59:26 -0800</pubDate>
		</item>

		<item>
			<title>Data Driven Testing</title>
			<link>http://blogs.qengine.com/2009/12/21/data-driven-testing</link>
			<dc:creator>rajasankar</dc:creator>
			<description><![CDATA[<p>In this post, answers for the questions such as what is data driven testing?, how that is important to test automation and how to get that data need to test? are discussed. <br></p><p>What is data driven testing?</p>In manual testing, using multiple values for the same course of action. In automated testing, using multiple values for same test script. <br><p>How this is important to test automation?</p><p>Using this method, testers can create highly maintainable test scripts. Additional data can be added to the data source(excel,database) with out modifying the test script.</p><p>How to get the needed data?</p><p>Using the black-box testing techniques such as Boundary value analysis, Equivalent partitioning and Error Guessing. You may read about these. However, lets see that. <br></p><p>Equivalent partitioning</p><p>To test the software with inputs from correct and incorrect data. For example, if you're testing a filed that will accept only positive integers. Positive integer, negative integer and alphabet inputs consists of three portions of data we need to test. With the equivalent partitioning method, one data from each portion is enough.&nbsp; <br></p><p>Boundary value analysis</p><p>In this, data in the boundary of the partition is take. Testing a field which accepts data from 10 to 20 will be tested with 9, 10, 19, 20, 21. <br></p><p>Error Guessing</p><p>This method relies on testers knowledge about the product,intuition and past experience. <br></p><p><br></p><p>Now, using these methods, the data is generated. However, we need to answer another question before starting this. Is the necessary to test the product with all these data? Is the possible to reduce the number of combinations needed?</p><p>Pairwise testing the answer for that question. Before trying that out, you can take look at Cem Kaner's <span><a href="http://www.kaner.com/pdfs/imposs.pdf" target="_blank">Impossibility of complete testing</a></span>. With that background work, you can prepre the data for the minimum set of possibilities needed test. Take a look at <span><a href="http://www.pairwise.org/">this website</a></span> more info on pairwise testing. You may interested to check James Bach's <span><a href="http://www.satisfice.com/tools.shtml">All Pairs</a></span> test case generation tool too.<br></p><p><br></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/12/21/data-driven-testing</guid>
			<pubDate>Mon, 21 Dec 2009 23:28:10 -0800</pubDate>
		</item>

		<item>
			<title>Using Version Control in QEngine</title>
			<link>http://blogs.qengine.com/2009/11/29/using-version-control-in-qengine</link>
			<dc:creator>rajasankar</dc:creator>
			<description><![CDATA[<p><span>Benefits of version control in a software project doesn't need any explanation. Adopting the same in test automation will benefit even teams have more than one member. In this post, we can see, what are all the files needed to be checked in the version control and how to maintain the setup.
<br>

<br>
Most of the files generated by QEngine can be opened using a text editor. Only files with QED extensions are binary files. You can only import those files in QEngine. 
<br>

<br>
When you create a suitea folder with the same name created under <qe home="">/projects. It contains conf,webscript folders. 
<br>

<br>
Conf folder - Has all the configuration related files
<br>
dataset - Contains data files
<br>
webscripts - Contains script files. Every script created will have a folder with the same name, which contains .wcs file and a map file if the script uses local level map. Information about the recorded objects is stored in an xml file which will be located in the conf folder, if the script uses global level map. 
<br>

<br>
All the three folders can be checked in the version control system. If you're using the custom scripts files which will be located in <qe home="">/jars folder, you can check in that too. 
<br>

<br>
You can replace the files in the same directory, if the original ones are lost or if you want to revert to the previous entires. 
<br>

<br>
Rajasankar
<br>
rajasankar at zohocorp dot com</qe></qe></span></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/11/29/using-version-control-in-qengine</guid>
			<pubDate>Sun, 29 Nov 2009 22:13:10 -0800</pubDate>
		</item>

		<item>
			<title>Free from object repositories - Use Expert Mode recording</title>
			<link>http://blogs.qengine.com/2009/11/23/free-from-object-repositories-use-expert-mode-recording</link>
			<dc:creator>Raghavan</dc:creator>
			<description><![CDATA[<p><span>Here i am going to discuss about the new recording option in QEngine which actually incorporates Recording / Playback and Manual Scripting.
<br>

<br>
In Record / Playback type of script authoring, normally the element data will be stored in a external Map file, and during playback the play engine will read the map file and fetch the required data from it and use it for identification in the DOM. In this mode, the tester will not be involving in the scripting much. But if there is any change in the GUI, then it will be difficult for the user to identify the property changed and modify the same in the map file.
<br>

<br>
In Manual Scripting, you have to author the script with some dynamic functions, where all the required element data will be stored in the script file itself. So, it will be clear to the user, which element is being handled and flow of script. In this mode the user has to author the script manually knowing all necessary data for element identification in the DOM. If there is any GUI changes, it will be easy for the tester to modify the details in the script itself.
<br>

<br>
QEngine introduced a new recording mode called <span style="font-weight: bold;">Expert Mode</span>. Using this you can record the script in manual authoring mode, thus the object repository (Map file) will not be required. Actions will be recorded with dynamic functions and all required element data will also be present in the script file itself.
<br>

<br>
This recording mode eases the tester from knowing all the element identification properties and manually authoring the scripts. The power of Manual Script Authoring can be attained in recording mode also. 
<br>

<br>
While start the recording itself you can choose to record in <span style="font-weight: bold;">Record in Expert Mode</span> or while creating the new script check the check box for <span style="font-weight: bold;">Record in Expert Mode</span>.
<br>

<br>
Hope this will be helpful for you to understand and automate your scripts quickly in the Expert Mode Recording.
<br>

<br>
Regards,
<br>
Raghavan
<br>
srinivasar at zohocorp dot com</span></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/11/23/free-from-object-repositories-use-expert-mode-recording</guid>
			<pubDate>Mon, 23 Nov 2009 21:20:48 -0800</pubDate>
		</item>

		<item>
			<title>Using NetBeans IDE for QEngine</title>
			<link>http://blogs.qengine.com/2009/11/06/using-netbeans-ide-for-qengine</link>
			<dc:creator>rajasankar</dc:creator>
			<description><![CDATA[<p><span>NetBeans released support Python recently. Check the features here <wbr><a href="http://www.netbeans.org/features/python/index.html" rel="nofollow" target="_blank">http://www.netbeans.org/features/python/index.html</a>
<br>

<br>
I've tried to use that IDE for editing QEngine custom scripts. Here are the steps,
<br>

<br>
1. Download and install the EA from here, <wbr><a href="http://dlc.sun.com.edgesuite.net/netbeans/6.7/python/ea2/" rel="nofollow" target="_blank">http://dlc.sun.com.edgesuite.net/netbeans/6.7/python/ea2/</a>
<br>
2. Create a new project. While creating the project, include the /QEngine home/jars folder in the Python path
<br>
3. Wait for NetBeans to scan and index the added folder
<br>
4. Now, you can use the IDE editor for editing custom script files including code completion.
<br>

<br>
Try and let me know.
<br>

<br>
Rajasankar
<br>
rajasankar at zohocorp dot com</span></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/11/06/using-netbeans-ide-for-qengine</guid>
			<pubDate>Fri, 6 Nov 2009 22:14:00 -0800</pubDate>
		</item>

		<item>
			<title>Separate Scripts and Functions-Script Maintenance in QEngine</title>
			<link>http://blogs.qengine.com/2009/09/15/separate-scripts-and-functions-script-maintenance-in-qengine</link>
			<dc:creator>rajasankar</dc:creator>
			<description><![CDATA[<p><span>Maintaining scripts is an important task in UI automation. Some times, it may be difficult to do. However, if we separate script flow and actual actions, we may able to maintain the scripts without any issues even the UI changes.
<br>

<br>
The formal approach.
<br>

<br>
Here is the steps to create for a test script w.r.t to QEngine
<br>

<br>
1. Create New Suite named as Test
<br>
2. Create New module in that suite if needed
<br>
3. Create New Script named as TestScript
<br>
4. Record the steps in TestScript. 
<br>
5. Playback when needed. 
<br>

<br>
Looks cool. Say, we have 100 scripts in that Test Suite. Playback is not an issue. Assume that one element changed in the UI. Now, we need to check and edit all the 100 scripts. This will neutralize any gains made using test automation. 
<br>

<br>
Here is the new model
<br>

<br>
1. Create New Suite named as Test
<br>
2. Create python file for UI functions named UIFunctions.py
<br>
3. Create python file for script flow named ScriptActions.py
<br>
4. Create New Script named as TestScript
<br>
5. Record or use export mode for recording the scripts. Create functions using recorded actions. Store the functions in UIFunctions.py
<br>
6. Call the functions needed in ScriptActions.py.
<br>
7. Call and import the script flow in TestScript.
<br>
8. Playback.
<br>

<br>
In this approach, if anything changes we need to modify in two files. Let see this with examples.
<br>

<br>
Content of UIFunctions.py
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
from Framework import *
<br>

<br>
def clickthisbutton():
<br>
    setLastWindow()
<br>
    <do some="" action="">
<br>
def clickthislink():
<br>
    setLastWindow()
<br>
    <do some="" action="">
<br>
def function1():
<br>
    <do some="" action="">
<br>
..........
<br>
.........
<br>
.....</do></do></do></td>	</tr></tbody></table><span class="postbody">
<br>

<br>
Content of ScriptActions.py
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
from UIFunctions import *
<br>

<br>
def Script01():
<br>
    clickthisbuttion()
<br>
    clickthislink()
<br>
    <do some="" action="">
<br>

<br>
def Script02():
<br>
    clickthislink()
<br>
    clickthisbutton()
<br>
    <do some="" action="">
<br>

<br>
def Script03():
<br>
    <do some="" action="">
<br>

<br>
def Script04():
<br>
    <do some="" action="">
<br>
..........
<br>
.......
<br>
.......
<br>
</do></do></do></do></td>	</tr></tbody></table><span class="postbody">
<br>

<br>
Content of TestScript01
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
from ScriptActions import Script01
<br>

<br>
Script01()
<br>

<br>
Content of TestScript02
<br>

<br>
from ScriptActions import Script02
<br>

<br>
Script02()
<br>
.......
<br>
.....
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>

<br>

<br>

<br>
In this approach, there is no need to edit the script files,even though they can be editied in the text editor. The files has .wcs extention and located in /QEngine Home/projects/<suite name="">/webscripts/ folder. 
<br>

<br>
If the UI changes, you need to either edit UIFunctions.py or ScriptActions.py or both. If needed you can use an macro to replace the changed parameter.
<br>

<br>
This approach combines the advantage of Scripting with Playback. If you wish, you can use the texteditor or IDE to edit the python files. 
<br>

<br>
Rajasankar
<br>
rajasankar at zohocorp dot com</suite></span></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/09/15/separate-scripts-and-functions-script-maintenance-in-qengine</guid>
			<pubDate>Tue, 15 Sep 2009 03:05:28 -0700</pubDate>
		</item>

		<item>
			<title>Do we still need Object Repositories in UI Automation?-II</title>
			<link>http://blogs.qengine.com/2009/09/08/do-we-still-need-object-repositories-in-ui-automation-ii</link>
			<dc:creator>rajasankar</dc:creator>
			<description><![CDATA[<p><span>Once, we embrace the idea of removing the object repositories from the automation, we can solve few issues to.
<br>

<br>
Say, we need to click on the "Add This", what are the options we have?
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">clickElement("Add This",1) </td>	</tr></tbody></table><span class="postbody">
<br>

<br>
Here the property of "Add This" stored in object repository.
<br>

<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">fireEventOnElement("ID","addthis","Add This",1,"Click","NONE","false") </td>	</tr></tbody></table><span class="postbody">
<br>

<br>
Here the property stored in the python file. 
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">fireEventOnElement(".*","innertext","Add This",1,"Click","NONE","true") </td>	</tr></tbody></table><span class="postbody">
<br>

<br>
Here the property stored in the python and if anything changes in the tag or property of the object except innertext, this function will be played. Why only innertext? Innertext will be the one exposed in web page which means if the function didn't play back, we can identify that easily.
<br>

<br>
What about the index or more than one Add This is present in the page?
<br>
If we know that index of those Add This, we can write that function based on that. If that more Add This may added in future, we can use 
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">getElementProperty(tagName,propertyName,propertyValue,index,propertyNeeded,regExpRequired='false')</td>	</tr></tbody></table><span class="postbody">
<br>

<br>
A simple loop like one below can check that.
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
i=1
<br>
while i:
<br>
    value=getElementProperty(".*","innertext",".*",i,"innertext","true")
<br>
    if value=="Add This":
<br>
       maxvalindex=i
<br>
       i=i 1
<br>
    else:
<br>
      break
<br>
  </td>	</tr></tbody></table><span class="postbody">
<br>
Using getElementProperty you can get the if any Add This property has been added and plan accordingly. 
<br>

<br>
Rajasankar
<br>
rajasankar at zohocorp dot com</span></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/09/08/do-we-still-need-object-repositories-in-ui-automation-ii</guid>
			<pubDate>Tue, 8 Sep 2009 23:41:56 -0700</pubDate>
		</item>

		<item>
			<title>Do we still need Object Repositories in UI Automation?-I</title>
			<link>http://blogs.qengine.com/2009/09/06/do-we-still-need-object-repositories-in-ui-automation-i</link>
			<dc:creator>rajasankar</dc:creator>
			<description><![CDATA[<p><span>Every UI automation software uses some form of object repositories. Before diving into the need of those, first let us know what is an object repositories and how it affects UI automation. 
<br>

<br>
When you record a action in the UI, the information about the object such as type,action performed,index in the page,input made if any and window name will be stored in a file. That file may be xml, excel,database,custom extension or binary format. At playback the object info is read and software will try to find the same object in the page to perform the same operation. The file in which the object stored is called Object Repository.
<br>

<br>
This object repositories work best when the UI doesn't change or web page has only static content. When the UI changes or the properties of object changed w.r.t page or entirely, then playback wont perform the action on that object. 
<br>

<br>
Even if we assume that object properties is not changed, the reading and executing the test will take more time and will grow exponentially with number of objects stored. Whatever the file format, automation software need to read the file, search for the object and execute the desired action. 
<br>

<br>
As most of pages has dynamic content and number of pages for any web hosted software increasing how do we tackle this issue?
<br>

<br>
My solution is simple. Get rid of Object repository or reduce the number of objects stored in that to minimum(subjective). Is that possible? May be. 
<br>

<br>
QEngine has few functions to do this. 
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">fireEventOnChildElement(tagName,propertyName,propertyValue,
<br>
  index,identifier,actionName,actionValue='',childpropname='',
<br>
  childpropval='',childindex=1,childRegExp='false',parentRegExp='false')
<br>
fireEventOnElement(tagName,propertyName,propertyValue,index,actionName,actionValue='',regExpRequired='false')
<br>
fireEventAtPosition(title,classID,xCoord,yCoord,actionName,actionValue='',waittime=1)
<br>
fireEventOnObject(classID,type,xCoord,yCoord,actionName,actionValue='')
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>
In these functions, property of the object has been stored in that python/WCS file. So, there is no need to read from the another file when playback. That will improve the performance into great extent.
<br>

<br>
Hey, wait a minute, you didn't answer what if the object property has changed?. Well that will be answered in second part of this post.
<br>

<br>
Rajasankar
<br>
rajasankar at zohocorp dot com</span></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/09/06/do-we-still-need-object-repositories-in-ui-automation-i</guid>
			<pubDate>Sun, 6 Sep 2009 22:53:35 -0700</pubDate>
		</item>

		<item>
			<title>ScreenCapture in UI Automation</title>
			<link>http://blogs.qengine.com/2009/08/27/screencapture-in-ui-automation</link>
			<dc:creator>rajasankar</dc:creator>
			<description><![CDATA[<p><span>ScreenCapture in UI Automation
<br>

<br>
In UI automation, how to know if the script played correctly?
<br>

<br>
One way is check the log messages and the check the output. That will be an cumbersome process to do. The better way is to see screenshots of the page. QEngine has a function to do this.
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">saveScreenShot(outFileName,waittime)</td>	</tr></tbody></table><span class="postbody">
<br>

<br>
You can call this way using the python function, if you need to generate filename automatically,
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
import time
<br>

<br>
def screenshot():
<br>
    filename=time.strftime("%Y_%m_%d_%H_%M_%S")
<br>
    saveScreenShot(filename,"1")
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>

<br>
There is an one limitation. This saves the file as a JPEG format and save the files in dataset folder in the projects.
<br>

<br>
You can write an Java class to save the images in the PNG format which will occupy less space than JPEG file.
<br>

<br>
Here is the code
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
import java.awt.Dimension;
<br>
import java.awt.Rectangle;
<br>
import java.awt.Robot;
<br>
import java.awt.Toolkit;
<br>
import java.awt.image.BufferedImage;
<br>
import javax.imageio.ImageIO;
<br>
import java.io.File;
<br>
import java.util.Calendar;
<br>

<br>
public class SaveScreen {
<br>

<br>
   public static void main (String args[])
<br>
   {
<br>
         }    
<br>

<br>

<br>
public void saveScreen() throws Exception 
<br>
{
<br>

<br>
   Calendar now = Calendar.getInstance();
<br>
   int year = now.get(Calendar.YEAR);
<br>
   int month = now.get(Calendar.MONTH);
<br>
   int day = now.get(Calendar.DAY_OF_MONTH);
<br>
   int hour = now.get(Calendar.HOUR_OF_DAY);
<br>
   int min = now.get(Calendar.MINUTE);
<br>
   int sec = now.get(Calendar.SECOND);
<br>
   String fileNameone = "Screenshot_" year "_" month "_" day "_" hour "_" min "_" sec ".png";
<br>
   
<br>
   Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
<br>
   Rectangle screenRectangle = new Rectangle(screenSize);
<br>
   Robot robot = new Robot();
<br>
   BufferedImage image = robot.createScreenCapture(screenRectangle);
<br>
   ImageIO.write(image, "png", new File(fileNameone));
<br>
}
<br>

<br>
}
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>
You can also change the 
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
String fileNameone = "Screenshot_" year "_" month "_" day "_" hour "_" min "_" sec ".png";
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>
into 
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
String fileNameone = foldername "Screenshot_" year "_" month "_" day "_" hour "_" min "_" sec ".png";
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>
if you need to save the files in the required folder. 
<br>

<br>
Refer to the previous blog entry for how to import your own code in the QEngine.
<br>

<br>
Rajasankar
<br>
rajasankar at zohocorp dot com</span></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/08/27/screencapture-in-ui-automation</guid>
			<pubDate>Thu, 27 Aug 2009 03:31:26 -0700</pubDate>
		</item>

		<item>
			<title>How to write your own Java code in QEngine.</title>
			<link>http://blogs.qengine.com/2009/08/26/how-to-write-your-own-java-code-in-qengine</link>
			<dc:creator>rajasankar</dc:creator>
			<description><![CDATA[<p><span>As you know QEngine based on Jython(Java implementation of Python), you can write Java code and import that in QEngine.
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
public class test
<br>
{  
<br>
  public static void main(String args[])
<br>
   {
<br>
   }         
<br>
  public void work()
<br>
{
<br>
<do something="">
<br>
}
<br>
}</do></td>	</tr></tbody></table><span class="postbody">
<br>

<br>
you can import that like this 
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
import test as te
<br>

<br>
t=te();
<br>

<br>
use the method mentioned there
<br>

<br>
def makework():
<br>
     t.work()
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>

<br>
If you need to use this method across multiple scripts, you need to create and python file under /QEngine/jars folder and import that in the scripts file
<br>

<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
workfile.py contains 
<br>

<br>
import test as te
<br>
t=te();
<br>

<br>
def makework():
<br>
     t.work()
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>

<br>
Use 
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
from workfile import * 
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>
or 
<br>
</span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr class="small">	  <td><span class="genmed"><b>Code:</b></span></td>	</tr>	<tr class="small">	  <td class="code">
<br>
from workfile import makework
<br>
</td>	</tr></tbody></table><span class="postbody">
<br>

<br>
Finally add the class in the classpath. Add this class entry to /<qe home="">/bin/StartWebTestServer.bat in "set CLASS_PATH=" line. You need to restart the server after this change.
<br>

<br>
Rajasankar
<br>
rajasankar at zohocorp dot com</qe></span></p>]]></description>
			<category><![CDATA[General]]></category>
			<guid isPermaLink="true">http://blogs.qengine.com/2009/08/26/how-to-write-your-own-java-code-in-qengine</guid>
			<pubDate>Wed, 26 Aug 2009 02:55:27 -0700</pubDate>
		</item>
	</channel>
</rss>
