Showing posts with label faq. Show all posts
Showing posts with label faq. Show all posts

SilkTest Question 44: How to email test results using Microsoft Outlook?

My indolent QA Manager wants me to send him the result of execution functional test every night and I'm been sluggish don not want to create and send emails manually. Can I send email with attachment using Silk Test?

Everything is possible in SikTest world. I use "partner -resextract -r "C:\Program Files\Segue\SilkTest\Projects\Winrunner\TestCase.pln" to extract test report. Next I created code below and save it as qtp.vbs (note vbs extension) and run newly created file with the following command "wscript qtp.vbs".

Dim objOutlook
Dim objOutlookMsg
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
objOutlookMsg.To = "manager@automated.software.testing.com"
objOutlookMsg.CC = "debug@automated.software.testing.com "
objOutlookMsg.BCC = ""
objOutlookMsg.Subject = "Nightly build verification completed"
objOutlookMsg.Body = "Dear SQA Manager, attached is the result of execution of my lame test"
objOutlookMsg.Attachments.Add "test report"
objOutlookMsg.Send

SilkTest Question 33: How to stop a running test case before it completes?

From my experience as interviewer around 25% applicants for QA Engineers position don’t know answer on this interview question although everyone of them has at least 2 years of experience with SilkTest automated tool.

To stop running a test case before it completes:

  • if your application under test is running on your host computer, press SHIFT+SHIFT
  • if your application under test in on target computer other than host computer, select Run/Abort from SilkTest menu

SilkTest Question 31 : How to update an Excel spreadsheet using SilkTest?

First of all the QA engineer should verify that ODBC data source, which SilkTest is going to use, is not set to read-only otherwise the Excel worksheet cannot be updated

The Microsoft's Excel OBDC driver does not support INSERT keyword, so QA Engineer will not be able to use this keyword in the SQL statement. Instead of INSERT keyword 4test code developer have to use to use the UPDATE keyword.

The following 4test example will update data in Microsoft Excel.

[ ]
[ ] HANDLE hDBC = DB_Connect("DSN=Documentation")
[ ]
[ ] HANDLE hSQL
[ ]
[ ] hSQLq = DB_ExecuteSQL(hDB, "UPDATE 'Sheet2$' SET 'Sheet2$'.Language='4Test' WHERE 'Sheet2$'.Name='Winrunner'")
[ ]
[ ] DB_Disconnect(hDBC)

Also take a look at SilkTest Interview Question 18: How to read data from Microsoft Excel worksheet?

SilkTest Question 26: How to repair *** Error: Application not ready error?

During automated regression testing of web based application QA Engineer presses one of the browser controls and gets the error described below:
*** Error: Application is not ready Occured in WaitForReady

The QA engineer could mumble only that the error above is not consistent, it happens sometimes on one of the computer on QA lab, but last month the same 4Test script works perfect on all computers during testing of previous release of the same application.


It looks like your web based application takes to long to respond and SilkTest times out. In this case the usual solution is to boost the timeout values. The test developer can set timeout values for individual script or set globally

The first value to check is 4Test agent OPT_APPREADY_TIMEOUT option, the number of seconds that agent waits for an application to become ready.

The second value to check nInvokeTimeout, an integer that specifies the number of seconds that SilkTest waits to the main window of application to appear.

SilkTest Question 18: How to read data from Microsoft Excel worksheet?

For QA purposes we are trying to read a block of cells from Excel spreadsheet and use values later for creating data driving automated test. The testing process set up in such way that we don’t want to use exact column names and prefer to just get data from cell numbers specified for example as B4:D11. Basically we want to obtain the cell values for all spreadsheet cells from B4 to D11 and print them out.

Try to create your test script based on the following code

[] hDBC = DB_Connect ("DRIVER=Microsoft Excel Driver (*.xls); FIRSTROWHASNAMES=1;READONLY=FALSE;
DRIVERID=790;DBQ=C:\QA.xls")
[] //run a SQL statement
[] hSQLq = DB_ExecuteSQL (hDBC, "SELECT * from [Sheet1$B4:D11]")
[] //while there are still rows to retrieve
[-] while DB_FetchNext (hSQLq, description, var1, var2)
[] print("{++i}:{ description } { var1} { var2} !")
[]
[] DB_Disconnect(hDBC)

For training purposes you have to take a look at SilkTest user manual for the following functions:
  • DB_Connect
  • DB_ExecuteSQL
  • DB_FetchNext
  • DB_FinishSql
and Datatypes:
  • HDATABASE
  • HSQL
Also take a look for the following answer about DBTester database functions.

SilkTest interview questions for QA Testers