Important SilkTest Interview Preparation Guide
Download PDF

SilkTest Interview Questions and Answers will guide us now that SilkTest is an automation tool for testing the functionality of enterprise applications in most versions of Windows, Solaris 9 and 10, and Red Hat Enterprise Linux WS 2.1 and 3.0, s learn SilkTest or get preparation for the job of SilkTest with the help of this SilkTest Interview Questions with Answers guide

146 SilkTest Questions and Answers:

Table of Contents:

Important  SilkTest Job Interview Questions and Answers
Important SilkTest Job Interview Questions and Answers

1 :: Can SilkTest run on Mac?

Ya, you can. Except that you will need Mac Runtime for Java (MRJ).

2 :: Is that because the RDC locks the desktop when I disconnect?

.. We're running SilkTest scripts on our lab machines. The lab machines share a monitor through a KVM. We connect to the machines using Remote Desktop Connection.
The scripts are being kicked off through a Windows Scheduled task. We're getting the message "Window cannot be set active".
It seems like if I login to the box in the lab then all is well, but if I've recently connected through Remote Desktop Connection the error occurs.
Is that because the RDC locks the desktop when I disconnect?
If I did a reboot before I run the scripts would that solve the problem?
I'm just trying to figure this out, so could be completely wrong on this.
So, any suggestions would be appreciated.


Answer1:
You should be able to adjust a setting for the task to 'wake' or 'unlock' the desktop prior to commencing the task. I recall having to do something like that in the past when I did this.

Answer2:
It's because Windows Remote Desktop (WRD) appears to tell the OS that the video card is something other than the actual video card. This is because you have a limited colour gamut using WRD. There are other limitations. When you disconnect, it seems to tell Windows on the guest machine that there's no video card at all and it lets Windows figure out what's up the next time you log in.
One option that our network admin suggested was to use VNC instead. This would mean we would use a different method just to attach to the SilkTest machine we have. It wasn't worth it for me, but it could be for you.
1) Your KVM switch has to be an electronic one because if it's not, the monitor won't have a screen rectangle. This was a limitation of the old hardware.
2) You have to circumvent the windows login screen and some security measures to get to the desktop which is where SilkTest will be running.

3 :: What is AUT?

AUT stands for Application Under Test.

4 :: Does we need to make changes in window declaration dialog box?

If two objects have the same logical name say for instance OK. How does silktest identifies the object, Does we need to make changes in window declaration dialog box?


1. In anyone window two objects can not have same logical name, It will give compiler error.
2. OK objects have same logical name two times but for different window..

5 :: How load testing can be done with silk international?

Answer1:
SilKTest is not a load testing tool - it is a functional testing tool. You could do a crude load test by having Silk on multiple boxes and then running each one at the same time - but that is very crude.
You need Silk Performer or Load Runner or some other load testing tool for doing load testing.

Answer2:
Do some performance testing on a local binary.
Imagine trying to load ten large files into a word processor or text editor manually. If the procedure is to load one large file and when it has loaded load the next. If performance degrades after each file has loaded. The first file takes 30 minutes to load, the second takes 75 minutes... This is a perfect candidate for using SilkTest (or another functional GUI testing tool) to perform It won't get bored waiting and it will be ready to load the file as soon as it reads the "Ready" status.
You could run a series of image transformations in an image editor, recalculate a budget for a large company in financial package after changing a few variables, edit a style sheet in a page layout and then scroll through the document, search and replace a single letter in a large text file, etc..
There are a lot of other single unit performance tests that can be run using SilkTest--use your imagination.

6 :: Is there a way by which the different components within the calendar be recongnised by silktest?

On web based application (developed in Java (jsp))., clicking on an icon opens up a calendar (pop-up calendar.js), which is a java applet, which is recognised by Silktest but not the various components (Month drop down, year drop down) within it. Is there a way by which the different components within the calendar be recongnised by silktest?


Try after enabling java extension....If you are using silk 7.x, try to do enable extension for the applet...It would copy the silktest java jar file to respective jvm....close you application and restart....It should work.....

7 :: To verify the file, the two files are same and also check whether the data in it is also correct How to do it using verify function?

Answer1:
Use the SystemFunctions in that case
SYS_CompareText
eg.:
letscompare = SYS_CompareText(sFile1,sFile2)

Answer2:
Open SilkTest (7.6 version)
From the Help Menu, select Help Topics. In the SilkTest Help module, click on the Search Tab. Type in the word Verify and then press the ENTER key. A list is displayed including, Verify function. Read that entry.
It explains how to use it and includes an example.

Answer3:
If ur text file is too big then follow this procedure
1) Read the actual text file and put the contents in a list (Say lsActual)
2)Read the expected text file and put the contents in a list (Say lsExpect)
And Read line by line and Print the mismatch line..
Check with the below code.It will work ..
[+] for ( iLine = 1 ; iLine <= ListCount (lsActContents) ;iLine ++ )
[ ]
[ ]
[-] if(lsActContents [ iLine] != lsExpContents [iLine])
[ ]
[ ]
[ ] bFailure = TRUE
[ ]
[ ]
[ ] fncLogMsg ( "Info", "The actual value in the {sActualFileVerified} text file " )
[ ]
[ ]
[ ] fncLogMsg ( "Info",
"{lsActContents [ iLine] }" )
[ ]
[ ]
[ ] fncLogMsg ( "Info",
"The expected value in the { sExpectedFileVerified } text file ")
[ ]
[ ]
[ ] fncLogMsg ( "Info",
"{lsExpContents [ iLine] }" )
[ ]
[ ]
[ ]
[ ]

8 :: What I have to do to use the same scripts for web based testing?

Same script can be used...Only URLs need to be updated....Might be some tags also but you can manage them using wild characters or multi-tag...

9 :: How to validate that the data inserted via silktest is successfully inserted and the record of each user is found in the database?

Using silk test to create automated user registration application. How to validate that the data inserted via silktest is successfully inserted and the record of each user is found in the database?


Answer1:
After inserting the record at the same time you can check that the record has been inserted or not.... say you are inserting the record with Insert statement (SQL) and after insert statement you can validate whether the select statement returns any record or not. If it returns the proper record, proceed or display error or whatever you wan't to do..

Answer2:
You can use database functions to connecto to your database and veryfy the data against the submitted data in the registration screen.
SilkTest supports relational data bases so you connect then through ODBC. check the help for db_connect(),db_fetch() etc. funtions

Answer3:
Your intention is to verify the data integrity in the DB for a single registration. There are couple of ways to do that. One being, if you have a list of registrations provided from UI, after the registration is done successfully, go the listing page and select the particular record and go to the properties of it and compare the values against the corresponding values given during the filling of registration form. The second way is that, try to write a query(as simple stored procedure) in the db that displays all the values for a single registration and call that stored procedure from silk test using data driven functions. For the help on data driven functions, refer to the online help. This is the only best way to learn silk test. You'll not find code samples on net.
A testcase for creating location. Silktest is reading location as html link. Locations are being stored alphabetically. But there is no tag associated with the latest tag (suppose its cg11). How to search for html link?


Below function is related to HTML Table. This function checks whether passed link-name is HTML link or not. "this" paramter is refered as "HtmlTable".
[+] BOOLEAN IsHtmlLink(STRING sLinkName)
[+] do
[ ] INTEGER iColCnt=0,iRowCnt=0,iNextCCnt,iNextRCnt
[ ] BOOLEAN bflag=FALSE
[ ] iColCnt=this.GetColumnCount()
[ ] iRowCnt=this.GetRowCount()
[ ]
[-] for (iNextRCnt=1;iNextRCnt<=iRowCnt;iNextRCnt++)
[-] if !bflag
[-] for (iNextCCnt=1;iNextCCnt<=iColCnt;iNextCCnt++)
[-] if (this.HtmlColumn("#{iNextCCnt}").GetRowText(iNextRCnt) == sLinkName
)
[-] if (Trim(this.HtmlColumn("#{iNextCCnt}").HtmlLink("#{iNextRCnt}").GetLocation()) !="")
[ ] bflag=TRUE
[ ] break
[ ]
[-] else
[ ] break
[ ]
[ ] return (bflag)
[-] except
[ ] return (FALSE)

11 :: How to launch 2 web application windows simultaneously thru Silktest?

Testing a login feature for web application.
In the first window login will be successful, in the second window it will show error that user is already logged in.
But with the Recovery system set in SIlktest I can only launch One application window at a time.
How to launch 2 web application windows simultaneously thru Silktest?


Browser.Invoke ()
Browser.LoadPage ("URL for login screen")
Browser.WaitForReday ()
// Do login
Browser.Invoke ()
Agent.SetOption (OPT_VERIFY_UNIQUE, FALSE)
Browser.LoadPage ("URL for login screen")
Browser.WaitForReday ()
// Attempt to login and verify the message
Agent.SetOption (OPT_VERIFY_UNIQUE, TRUE)
Browser.TypeKeys ("<Alt-F4>")

12 :: Executing more than one testcase. suppose in first testcase has one functions that is returning some string value. How to use first test case value into second test case?

Answer1:
At the top testcase , to declare something like:
create a global variable gPersonReferenceNumber and pass this into testcases as required.

void TestScriptSetup()
SetAppState ("YOURAPPSTATE")
gPersonReferenceNumber = CreateMinimalTestPerson()

testcase CallGlobalReference() appstate none
string sPersonString = gPersonReferenceNumber

etc
TestScriptSetUp() will be ran prior to CallGlobalReference. You can also include this into your recovery system if need be.

CreateMinimalTestPerson() returns a string value related to PersonID or whatever you would require

Answer2:
1. Use some public (global) variables to store your value
2. Writed testcase to return values, whatever you want and use it in later testcases..

Answer3:
To put it into an ini file or the registry.

Answer4:
Set the values in environment variables by SYS_SetEnv () and use them by SYS_GetEnv () wherever, whenever you want......Global variables also do this, but when you call the test cases from a plan file, global variables get reset......
Other alternative are to store them in a file and use them .

13 :: Whether it will help you to get good opportunities on Silk after certification?

First of all it is very expensive ....( it cost around Level 1 - $150 + training - Rs 15000 +level 2 - $200)
Second you will learn indepth of silktest in the advanced training which is compulsory to take level 2 exam. Personally I felt this is useful even if you have 5 yrs expericne in silktest you will learn more about complete tool.
Leavel 1 is online and they did not change the question papre for long time. I know few people who are scoring more than 95% just because of that.
Segue certification stratagy is not that great like mercury I felt very bad when I heard few people who doesn't know anytihng about silktest test did their certification. (In india it too bad, I have no idea in another contries).
Sad part is there I konw some people who are able to take exam without paying fee also :( ( guess how strong their training division is )
Finally certification is only useful for decorating your cv. If you really have hands on experience in the tool no need go for certification.

14 :: Trying to create a datadriven tests

Trying to create a datadriven tests. Placed the .xls file in a data folder. The script should connect to the .xls file, open the file, read the contents in the .xls file and fill the form with the values. I have written some steps using the Help guide. Its not working i get errors Can any one suggest me the list of steps and in which folder these steps should go.
The following error:
C:Program FilesSegueSilkTestexamplesframe .inc(2): Window class BrowserChild is not defined or ambiguous
Database connectivity - Found word(s) list error in the Text body
the following error now:
Error: Variable (frmCompanyName) has not been set
Also I did the variable declaration as follows
[-] testcase DD_Test1 (REC_DATALIST_DD_Test1 rData)
[ ] STRING frmCompanyName
[ ] STRING Phone
[ ] STRING Contact
[ ] STRING Title
[ ] STRING Insights
[ ] STRING CoInsights



This looks like more of a scoping issue in Silktest than a problem with any DB connection to an excel file. Since I am heading out the door in just a few, I will have to take a closer look at this tommorow but typically, my data driven scripts are structured sort of like:
[ ] //this reads the data from the spreadsheet and then iterates
[ ] use "P:Silkauincludesautoarch_temp.inc"
[ ]
[-] main()
[ ] HANDLE hDB
[ ] HANDLE hSQL
[ ] STRING sFirstName, sLastName, sAddress, sEmail, sComment, sExpected, sItem
[ ] INTEGER iCase, iPF, iRun
[ ] LIST OF STRING lsCases
[ ] STRING sQuery = "Select * from `Sheet1$`"
[ ] //open spreadsheet:

[ ] hDB = DB_connect ("DRIVER=Microsoft Excel Driver (*.xls);DBQ=P:QARelease11.1AUAutomationcontact_validation_words11_ 1.xls; READONLY=FALSE")
[ ] hSQL = DB_ExecuteSQL(hDB, sQuery)
[-] while DB_FetchNext(hSQL, iCase, sFirstName, sLastName, sAddress, sEmail, sComment, sExpected, iPF, iRun)
[ ] //print("{iCase} {sFirstName} {sLastName} {sAddress} {sEmail} {iRun}")
[-] if iRun == 1
[ ] ListAppend(lsCases, "{iCase}|{sFirstName}|{sLastName}|{sAddress}|{sEmail}|{sComment}|{sExpec ted}|{iPF}|{iRun}")
[ ]
[ ] DB_FinishSql (hSQL)
[ ]
[-] for each sItem in lsCases
[ ] TestContactInfo(sItem, hDB)
[ ]
[ ]
[ ]
[ ] DB_Disconnect(hDB)
[ ]
//-----------------------------------------------------------
[-] testcase TestContactInfo(STRING sTest, HANDLE hDB optional)
[ ] //logic to feed the functions and methods to run the cases and determine pass/fail.
[ ] //can even write results to the same excel file, if need be.
And of course, there are going to be plenty of people out there with var. setups (plans, suites...)
I am not using any frame file with my scripts.I dynamically get all the links in a web page and click on the link I want to, by matching its caption....The problem I am facing is that, when I click a link "x" on a webpage it opens a new browser window.I would like to verify the title of the new browser window that just popped after clicling link "x".Since I am not using frame file I find it difficult to retrive the title of new browser window.....Any solution ?


Ttry with GetCaption ()....
BrowserPage.Getcaption () --> It would return the caption/title of the page...Compare it with the expected value...
Yes, here you have to make sure that the new invoked page gets the attention.....
BrowserPage.SetActive ()
BrowserPage.Getcaption ()
if
the caption is not same as the initial page, this is the new invoked page and what you desire
else
Desktop.TypeKeys ("")
if
if BrowserPage.IsActive ()
get the caption and check as earlier
else
Desktop.TypeKeys ("")

This is just a rough algol, you have to implement it with appropriate loop so that it becomes independent of the number of currently invoked windows....

16 :: How to automate .Net application?

How to automate .Net application?
(I am using Silk v7.5 to automating .net application. But most of the control were not recognized by Silk. when I was forcefully mapped with standard Control then also its not works.)


Try to get .Net Extension... You have to pay separate fee for this Extension.....

17 :: What is the meaning of the Automation framework especially in SilkTest?

Automation Framework is a discipline and should have proper design/architecture. You can understand and implement. Automation Framework should have some of following things.
1. AUT Specific libraries
2. Tool wrapper function libraries.
3. Execution Engine (Script Execution should be drived based on given test data) - Data Driven
4. Results reporting mechanisms (PASS & FAIL for each testcases/procedures and compiled results for all. It would be better, if it captured AUT's snapshots) 5. Planning for long term automation.
6. Keeping GUI objects info/declarations dynamically or static.
7. Planned approach of unattended execution.

Also framework design differs by tool, scripting languages and type of AUT etc,. Now a days, people are using PERL, PYTHON, TCL/TK for CLI automation. This design will vary much from GUI specific tool automation's design (QTP, Winrunner, Silktest,Robot and QARun etc).
You can go through following links. Each link is giving different set of components for Automation framework.
Totally Data-Driven Automated Testing http://GlobalGuideline.com/
Test Automation Frameworks http://GlobalGuideline.com/view.php?ID=601

18 :: How can we Increase the virtual memory in Silk Test?

I think the licensing admin UI IS java. You can easily check by using Silk itself. (Try enabling Extensions wizard on the license admin UI). As for Silk the chances are that its MFC, as I have worked with its earlier avataar, Quality Assurance Partner, which itself was there before Java, I believe. That might be the reason it works best with MFC apps..

19 :: What is the solution for this?

In the application, identify the objects in framefile. Suppose if one the abjects is custom object, you map custom object to standard object. Even after mappiing the custom object to standard object if the silktest does not idenify the object. What is the solution for this?


First you have to try by enabling various extensions so that the application could be recognized....Even if not possible, the last option is co-ordinates.....but these are not very much reliable unless done properly.....

20 :: Any ideas how to customize the default recovery system in order to close dialog boxes?

Any ideas how to customize the default recovery system in order to close dialog boxes that are parented not to MainWin but to ChildWin would be greatly appreciated.
The default recovery system only checks those dialogs that are parented to the MainWindow specified in the wMainWindow constant.
the problem is that I want to use any recovery system that will allow me to close dialog boxes that are parented not to MainWin and I need some hints on this (using dll functions like GetForegroundWindow(), or something else).
Windows NT 4.0 with SP4, and SilkTest 5.0.


Answer1:
Well, this wouldn't be changing the default recovery any, but you could use an appstate that is basedon none rather than basedon DefaultBaseState.

Answer2:
Create a global variable
lwClose = {...}
Windows to close

and add a
TestcaseExist ()
window wClose

for each wClose in lwClose
if wClose.Exists ()
wClose.Close ()


Answer3:
Here's what you do,
In a given tree structure like this:
Win1 Win7
Win2 Win3 Win8 Win9
Win4 Win5 Win6
Notice that Win7 and Win1 have 2 different threads,
Whenever you declare a window: You just add it to the lwClose list.
Here's How: (assuming you just want to keep Win1 open
lwClose = {...}
Win9
Win8
Win7
Win6
Win3
Win5
Win4
Win2
That way you create your tree threads.
Or you can create a fancy Dismiss ()
which does the following:
for i = 1 to ListCount (lwClose)
do
for each wClose in lwClose
wClose.Close ()
except
do nothing (this is incase you cannot close a window before another

Answer4:
I haven't tried this, but, could you create your own ScriptExit or TestcaseExit function that overrides the ScriptExit or DefaultTestcaseExit?
Or could you use the lwLeaveOpen defined in your MainWin and put the dialog name there? Perhaps you could make the variable lwLeaveOpen *not* const and then in either ScriptExit or TestcaseExit put the dialogs you want to leave open. And/or use the GetNextCloseWindow method to close everything down to the dialog you want to leave open.
To get a better understanding of how the recovery system works, I suggest you read the defaults.inc file (but I don't recommend editing it; use ScriptExit or TestcaseExit to override it).

21 :: For a registration purpose I am entering some data?

For a registration purpose I am entering some data.. and again for other iterations the testcase going to fail why because...session cookies are still presentand entire test cases are going to fail .. what I have to do...clearcache is also not working...


Answer1:
We had much of the same kind of issue. The only way around this was to not accept cookies, if the application allowed for it or we killed the browser between tests and went and deleted the cookie repository directly.

Answer2:
You will have to write a small code that will clean the cache - Browser Tools menu->Internet Options, then Click on Delete Cookies and Delete Files. You can make this a part of your App state so that it run everytime before you start a test case.

22 :: How to get contents of a web page? (For Ex: Yahoo homepage)?

BrowserPage.SetActive ()
Clipboard.SetText ()
BrowserPage.TypeKeys ("<Ctrl-a>")
BrowserPage.TypeKeys ("<Ctrl-c>")
list of string lsText = Clipboard.GetText ( ) // holds the browser page content

23 :: How can we use more than one browser in silktest. Suppose I want to use three browser how do write script for this case?

Use both IE and Netscape simultaneously......you have to make changes in the tag....

24 :: I want to set current path run time?

I want to set current path run time - means if I am having scripts on *C:Silktest*XYZ.pln then in Initialise function - I want to set path as
*C:Silktest *
How to do that in ST ?
Also I want to set few run time options , not thr' run time option dialog box but pragmatically Note ::All options present in Runtime dialog
1. Use files
2. Result file path
I checked for .opt file option ..
that is for Agents ONLY I guess..



The "CurrentPath" would return the current path.....Manipulate this string to set your current path......
In .opt file set
[Runtime]
UseFiles=C:SilkTesttest.inc;extendexplorer.inc;so on.........
ResultsPath=C:Silktest

25 :: How to write the single silk statement in two lines?

Answer1:
Use Shift+Enter

Answer2:
Very easily found in the online help under:
1) line breaks in code
2) line continuation character
SilkTest Interview Questions and Answers
146 SilkTest Interview Questions and Answers