Sunday, October 17, 2010

First experience on Silktest2010

SilkTest2010 is launched in a suite which includes SilkTest Workbench、Silk4NET、Silk4J、SilkTest Classic and other major components.


MicroFocus brought Borland SilkTest and Compuware TestPartneer to intergrate these two QA automation tooles.


SilkTest Product Suite
The SilkTest product suite includes the following components:

• SilkTest Workbench – SilkTest Workbench is the new, native quality testing environment that offers .NET scripting for power users and innovative storyboard-based visual tests to make testing more accessible.

• Silk4NET – The Silk4NET Visual Studio plug-in enables you to create Visual Basic or C# test scripts directly in Visual Studio.

• Silk4J – The Silk4J Eclipse plug-in enables you to create Java-based test scripts directly in your Eclipse environment.

• SilkTest Recorder – SilkTest Recorder enables you to record and replay tests using a GUI and then export those tests to SilkTest Classic, Silk4J, or Silk4NET.

• SilkTest Classic – SilkTest Classic is the traditional, 4Test SilkTest product.

• SilkTest Agents – The SilkTest Agent is the software process that translates the commands in your tests into GUI-specific commands. In other words, the Agent drives and monitors the application you are testing. One Agent can run locally on the host machine. In a networked environment, any number of Agents can run on remote machines.

Note: you need install VS2010 to install Silk4NET,,for installing Silk4J, you need install Eclipse first

SilkTest 2010 runs on the following platforms:

• Windows XP SP3

• Windows Vista SP1 or SP2

• Windows 7

• Windows 2008

• Windows 2008 R2


Note:SilkTest no longer support Windows XP Sp2 and Windows 2003 Server.


End-Of-Life (EOL) Components

The following operating systems, features, and integrations are not supported in SilkTest 2010.

• StarTeam integration

• PVCS integration

• SilkTest Classic 4Test outline Editor mode

Note: SilkTest Classic will continue to be supported. This change will not affect most SilkTest Classic users.

• Java 1.4

• Windows 2003 Server

• Windows XP SP2


Adobe Flex Support(no support for Flex4)
SilkTest supports testing Flex 3.0, 3.2, 3.3., 3.4, and 3.5 using the following:

• Internet Explorer 8 (GA)

• Internet Explorer 7 (GA)

• Firefox 3.0, 3.5, 3.6 (playback only)

• Standalone Flash Player 10

• Adobe AIR

• Internet Explorer 6 (SP 1 and SP 2)

Note: Currently, Adobe offers experimental support for Flex applications in AIR. As a result, you may encounter issues when testing Flex in Adobe AIR that are not related to SilkTest.

for supporting Java
Open Agent Support

SilkTest supports the following Java components for SilkTest Workbench, SilkTest Recorder, Silk4NET, Silk4J,SilkTest Classic using the Open Agent:

• Eclipse 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, and 3.6 SWT standalone and Rich Client Platform (RCP) applications (SWT standalone applications executed as an applet in the browser not supported, embedded IE control inside of SWT standalone or RCP application not supported)

• Java version 1.5 and 1.6

Classic Agent Support

SilkTest supports the following Java components for SilkTest Classic using the Classic Agent:

• IBM JRE 1.5

• Java version 1.5 and 1.6

• AWT

• Java Foundation Classes (JFC, Swing)

• Symantec Visual CafĂ©

• Applets

Note: Applets not supported by IE8.



SilkTest Workbench new features:


Visual Tests
SilkTest2010 Visual Tests is similar with QTP Keyword View and Active Screen


SilkTest Workbench lets you quickly record and playback visual tests. Visual tests comprise the basic building blocks of an automated testing solution. SilkTest Workbench uses visual tests to mimic the actions that are performed while testing an application. With visual tests, you can:

• Record visual tests automatically, manually edit them, or use a combination of automatic and manual tests.

• Visually modify or create test steps and access step properties without having to access the live test application.

• Use the Visual Navigator to view information displayed in four panes that collectively provides a comprehensive view of each step in a visual test.

The Screen Preview, Storyboard, and Properties panes are synchronized with the Test Steps pane and display information specific to a selected step in the Test Steps pane. In this way, you can easily view all aspects of a step by selecting a step in the Test Steps pane, and then viewing information about the step in the other panes.

• Use the Identify Object dialog box to identify the locators for an application's objects and the properties for each object.

• Create test logic, including conditions, expressions, verifications, and error handling using the Test Logic Toolbox.

• Add synchronization steps to delay or wait for objects during playback.

• Configure the settings that dictate how and what actions are recorded and replayed.

• Review detailed test results, which provide a step-by-step record of the actions executed.


Embedded Scripting Language
SilkTest2010 Workbench use VB.NET as script language.

SilkTest Workbench's scripting language is Microsoft's Visual Basic, a robust programming language that gives you total control over any application running in the Microsoft .NET framework. .NET scripts contain the functionality of a high-level programming language as well as features designed specifically for software control and testing. With scripts, you can:

• Record scripts automatically, manually edit them, or use a combination of automatic and manual tests.

• Leverage .NET scripting features to make manual scripting easier. These features include:

• Identify Objects dialog box – View how locators identify the GUI objects within the test application and which properties are available for those objects.

• Auto-completion and Syntactical Assistance – These facilitate manual coding. Using auto-completion and syntactical assistance, you can automatically access, display, and enter .NET language elements, including keywords, enumerations, Boolean values, code syntax, available methods, and available .NET properties for any object.

• Create scripts to cover individual parts of a whole test flow, then use a driver script to call each part.

• Add .NET assemblies from the .NET framework as references for a .NET script.

• Add a file that the script references to logically segment code for distinct purposes.

• Compile and run scripts and use the Output window to review automation code and append additional user-defined output to provide supplemental information about a script.

• Find and replace code in scripts to speed script modification.

• Use bookmarks to navigate to key portions of the script.


SilkTest 2010 Release - Known Issues

http://kb.microfocus.com/display/4/kb/article.aspx?aid=31481

Saturday, October 16, 2010

Slow record and playback of visual tests with the SilkTest Workbench

Problem:
You may experience slow record and playback of visual tests when using the SilkTest Workbench if you are testing a large webpage that contains a lot of objects. One example of this is the Ext GWT Explorer Demo site at http://demo.borland.com/samples/explorer.html#overview.




This is due to time taken to capture all of the objects properties and screenshot capture when actions are performed.

By default SilkTest Workbench will take a screenshot when a user performs an action, this pauses the browser until the screenshot is taken and all properties of controls are captured. Once this is complete the browser is released to continue. This causes the slowness of recording and playing back of visual tests.

Resolution:
It is possible to turn off Control capture and Screen capture. In order to do this go to Tools – Options in SilkTest Workbench.


In the Options dialog window go to Record – Output – Visual Test.

Control capture and Screen capture can be configured separately. The various options are as shown below:

Control capture
Allows SilkTest Workbench to capture controls and their properties during recording. The controls can then be selected using the Screen Preview. The only options for Control capture are "Yes" or "No".

Screen capture
Determines how SilkTest Workbench captures target application screens during recording. Options are as follows:

Active Window: Captures only the target application's active window during recording.
Application: Captures the target application and any windows within the target application.
Desktop: Captures screens of all applications, including the target application, that are visible in the desktop during recording.
None: Captures no screens during recording.

Creating robust, reusable SilkTest Workbench functions

Problem:
Is it possible to create reusable functions using SilkTest Workbench?
Resolution:
As SilkTest Workbench leverages VB.Net as its scripting language, we can create functions that can be reused to perform functionality that will be commonly replayed or functions that will be commonly used to query your application. For example, you are required to search a table control for the row and column values that contain a specific value. As this functionality is not provided "out-of-the-box" we are required to create our own function to do this. The function below highlights how this is achieved in VB.Net.


'returns a cell with 0 based row and column values
Public Function FindCell(table As SWTTable, sCellValue As String) As Array

Dim cell(2) As Integer
Dim bBreak As Boolean
Dim maxRows,rowCount,maxItems,itemCount As Integer
Dim curRow As SWTTableRow

'Set maxRows to the amount of Rows in the Table
maxRows = table.RowItems.Capacity

'Check each row for the cell of interest
For rowCount=0 To maxRows-1

'Get the current Row
curRow = table.RowItems.Item(rowCount)

'How many cells are in this row
maxItems = curRow.ItemCount


'For each cell in that row
For itemCount=0 To maxItems-1
'Is this the cell we are looking for
If curRow.Items.Item(itemCount) = sCellValue
'Set the cell values
cell(0) = rowCount
cell(1) = itemCount
bBreak = True
'As we have found the cell, exit the for loop
Exit For
End If
Next itemCount

'As we have found the cell, no further rows need to be checked
If bBreak
Exit For
End If

Next rowCount

'if the row was not found set the cell row and column values to -1
If bBreak = False
cell(0) = -1
cell(1) = -1
End If

'return the cell value
Return cell
End Function


At present this function can be slotted into any .Net Script within SilkTest Workbench that requires the functionality to search a SWTTable control for a cell containing a specific value. Its use within a .Net script would therefore look like the following:


Public Sub Main()
Dim cell(2) As Integer
cell = FindCell(_desktop.SWTTable("/Shell[@caption='SWT Controls']//SWTTable"), "CellValue")
MsgBox("Cell: {"+cell(0).ToString()+", "+cell(1).ToString()+"}")
End Sub

Location of the SilkTest Open Agent log files

Problem:
Where are the SilkTest Open Agent log files?
Resolution:
The Open Agent log files are in two different places depending on the operating system.

WindowsXP/2003: C:\Documents and Settings\\Application Data\Silk\SilkTest\logs

Windows Vista/7/2008: C:\Users\\AppData\Roaming\Silk\SilkTest\logs

Verifying bitmaps with SilkTest Workbench

Problem:
Is it possible to verify that two bitmaps match using SilkTest Workbench?
Resolution:
SilkTest Workbench does not provide an in-built function for verifying that 2 bitmaps are the same. However, we can leverage against the Bitmap class within the System.Drawing namespace to build our own function that will perform the required functionality. The function below highlights how we can verify that two bitmaps stored on disk are the same:


Public Function compareBitmaps(source As String, compare As String) As Boolean


Dim srceBmp As New Bitmap(source)
Dim compBmp As New Bitmap(compare)

Dim srceHeight, srceWidth As Integer
Dim compHeight, compWidth As Integer

'Get Height Width for source bitmap
srceHeight = srceBmp.Height
srceWidth = srceBmp.Width

'Get Height Width for comparison bitmap
compHeight = compBmp.Height
compWidth = compBmp.Width


'If the values are different the images are different
If(srceHeight <> compHeight Or srceWidth <> compWidth)
Return False
End If


'Check the pixels match in each image
Dim width, height As Integer
width = 0
height = 0

For height=0 To srceHeight-1
For width=0 To srceWidth-1
If srceBmp.GetPixel(width,height) <> compBmp.GetPixel(width,height)
Return False
End If
Next width
Next height


Return True
End Function


Using the above function as the base function for comparing bitmaps, we can create a verifyBitmap function similar to that in SilkTest Classic. The function below accepts a TestObject and a string representing the base bitmap to which a controls visual appearance must be compared:

Public Function verifyBitmap(wObj As TestObject, sComp As String) As Boolean
Dim sTemp As String
'Store a bitmap of the TestObject in the users temp directory
sTemp = System.IO.Path.GetTempPath()+"\verifyBMP.bmp"

wObj.CaptureBitmap(sTemp)

'compre the temporary image to the base image and return the result
Return compareBitmaps(sTemp, sComp)
End Function

SilkTest 2010 Release - Known Issues

SilkTest 2010 Release - Known IssuesCreated On: 20 July 2010
Problem:
SilkTest 2010 Release - Known Issues
Resolution:
This list contains known issues and provides workarounds where available:

•HierarchyHeaderWidth and ColumnOrder Properties of the SAPTree Class are write only
•GetColumnIndexFromName() of the SapTree Class May Fail with an "unspecified error"
•Calling the Select() Method of the SAPTree Class on a Context menu item may fail
•The position property for a horizontal scrollbar always returns 1
•Using Google toolbar interferes with recording web applications
•The default value for OPT_BITMAP_MATCH_COUNT has changed from 5 to 0
•Message boxes display in the background when a script plays back
•The SAPNetPlan class is not supported
•Str function does not round correctly
•Installer fails to install SQL Server Native Client and register SilkTest Workbench as a COM server
•Modifying the hot key combination to include multiple modifiers causes additional keys to be recorded
•SQL Server DSN does not work on 64-bit systems
•Replay error occurs when executing an SAP script in fast mode
•When executing a SilkTest Workbench script from SilkCentral Test Manager, an error occurs
•When an application prompts a user on exit, errors occur during playback
•"License Check Failed - Agent is running in SCTM mode" error occurs when running a test in SilkTest Workbench
•SilkTest Workbench requires a network connection to start

Enable SilkTest Extenion on on 64 byte system

Everybody know, if you are going to enable SilkTest Extenion on Windows 7 32 byte system, we must install SilkTest 2009R2. But if we are going to enable extention on Windows 7 64 byte system, we will find there still some issues when enabling the extension although 2009R2 has already been installed. What I mean when enabling Extensions dialog box, then restart test applicatoin, the "Test" button is still disabled. This causes we are unable to Enable".
We found the solution for soloving the problem after research and experiment. SilkTest installer didn't install some files properly on 64 byte machine. You need copy few DLL to related folder to solving the problem: copy 4 files qapabort.dll, qaphooks.dll, qapjarex.dll, qapjconn.dll from 64 byte system C:\Windows\System32 folder to C:\Windows\sysWOW64 folder. After Reboot SilkTest,then perform "Enable", we found we can enable the Extension successfully for testing the application.