SilkTest

  Home  Applications Programs  SilkTest


“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

121⟩ How actually ST works internally from developers point of view?

Answer1:

Silk interacts with the GUI to submit operations to the application automatically, i.e., it drives the application.

It consists of two distinct software components:

(i) The Silk host software, and

(ii) The 4Test Agent software.

The host software is the program you use to develop, edit, compile, run, and debug your 4Test scripts & test plans.

The 4Test Agent is the software process that translates the commands in your 4Test scripts into GUI-specific commands. One Agent can run locally on the host machine, and in a networked environment, any number of Agents can run on remote machines.

Answer2:

Silk - or any compitant GUI auotmation tool works this way:

1. You need to record the GUI of the application .. this is like telling Silk what its goign to work on.

2. Using the recorded GUI of the application, you scrript your test cases,

3. On a new build, you re-execute your test cases.

Any failures are due to :

1. Application error

2. Script error

In case of script error it might be:

1. A logical error,

2. Change in product behavior leading to script error (so the script needs to be updated)

3. OR, the GUI of the application has changed, which means that you need to update the GUI recorded with Silk

When an auotmation tool records the GUI, it basically captures each GUI object along with certain properties of that GUI. These properties are needed to identify the GUI to the tool the next time automation is run

To give you an example, lets say that on a typically user login page, there are three gui entities:

1. The Username field

2. The password filed

3. The login button

assuming login button has an htm lid=login, silk would record this gui as a HTMLPushButton having the id property = login. (The text caption associated with the button might be different i.e. "Log in")

Lets say that it was decided to change the caption of this button to "Sign In", leaving the html iid property the same i.e. login. In this case Silk would continue to playback the GUI automation scripts w/o problem.

BUT in case

In the next buildl, the dev has kept the Button caption same; i.e "Log in" but chnaged the html id of the button to "signin", then Silk WILL NOT recognize the button, even if for the user (i.e. the person) nothing has changed (he still continues to see a button with text "Log in")

This is the basic principle on which most automation tools work.

Answer3:

Basically SilkTest has two software

(i) The Silk host software, and

(ii) The 4Test Agent software.

The host software is the program you use to develop, edit, compile, run, and debug your 4Test scripts & test plans.

The 4Test Agent is the software process that translates the commands in your 4Test scripts into GUI-specific commands.

But question arrises how it wors and see or identify object ??

While you record window declarations, SilkTest attempts to identify the class of each object in your GUI and assign the appropriate class from the built-in class hierarchy. If it is success and belongs to a standard class either MFC or JFC class then objects is idenified. SilkTest contains algorithms to interrogate the objects based upon the standard libraries. When these algorithms work the object is identified,if not then SilkTest reports the object as a CustomWin. An object is defined by:

· Its actual class name

· The underlying software code that creates and manipulates it

 110 views

122⟩ Has anyone had any experience using the Japanese version of SilkTest?

Has anyone had any experience using the Japanese version of SilkTest? We are currently evaluating the need for Japanese SilkTest for testing East Asian software products. I'd like to find out what specific features the Japanese version of Silk supports that the English version does not.

Segue told us that they did not have a Japanese version of SilkTest. They have a Japanese version of QA Partner 4.0. We tried their internation version of QA Partner 4.0. This supported double-byte characters in the application under test, but the QAP user interface was in English.

 127 views

124⟩ On the test GUI there is Cancel button and the hot key for that is Alt-c?

On the test GUI there is Cancel button and the hot key for that is Alt-c. Alt-c & Alt-C (both lower & upper) should work and manually they are working fine....

Through automation, TypeKeys ("<Alt-c>") is working but TypeKeys ("<Alt-C>") is not working.....

I also tried with

Presskeys ("<CapsLock>")

TypeKeys ("<Alt-c>")

ReleaseKeys ("<CapsLock>")

and

Presskeys ("<Shift>")

TypeKeys ("<Alt-c>")

ReleaseKeys ("<Shift>")

but still no results.....

Any suggestion?

If your application is a standard application and the Keys are well defined, ideally it should work irrespective of ("<Alt-c>") and ("<Alt-C>") , as it seems not your case , so please try this.

SilkTest provides facilities to incorporate groups of keys that you want pressed simultaneously in the same set of angle brackets, and separate the keys with hyphens.So Please try this

("<Alt-shift-c>")

neither TypeKeys ("<Alt-shift-c>") nor

TypeKeys ("<Alt-CapsLock-c>") nor

TypeKeys ("<Alt-CapsLockOn-c>") nor

TypeKeys ("<CapsLockOn>")

TypeKeys ("<Alt-c>")

works......

Only TypeKeys ("<Alt-c>") works when CapsLock is off.....if I manually switch on the CapsLock and execute the same statement [TypeKeys ("<Alt-c>")] , it doesn't work.....

 116 views

125⟩ 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.

 142 views

127⟩ 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.....

 133 views

128⟩ 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..

 124 views

129⟩ 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

 129 views

130⟩ I would like to verify the title of the new browser window that just popped after clicling link?

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....

 147 views

131⟩ 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).

 141 views

132⟩ 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...)

 120 views

133⟩ 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.....

 116 views

134⟩ 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.

 110 views

135⟩ 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 .

 143 views

136⟩ 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>")

 124 views

137⟩ How to search for html link?

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)

 122 views

139⟩ 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.

 128 views

140⟩ 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] }" )

[ ]

[ ]

[ ]

[ ]

 117 views