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

61⟩ How to hide Password in the script file?

In Winrunner, the password is recorded in the encrypted form but in Silk it is recorded as it is.....

Can't be done right within the script, but if you want to make a work around, you could read it in from a file.

If that's not good enough (the password would be stored in the file in plain text too), you could use a tool to encrypt the password and use that tool to decrypt it. You could then make a call to an external language (Ruby, Perl, Python, etc.) to do the heavy work of encrypting and decrypting the information and pass that through as a variable.

The problem is that whatever method you use to enter the password unencrypted into the login screen can also be used to just write it to a file.

Don't use your own account. Use a dummy, testing account.

 212 views

62⟩ What .OPT file is used for?

.opt file is used to set the options.......

Say in your script you set the option

Agent.SetOption (OPT_WINDOW_TIMEOUT, 5)

Agent.SetOption (OPT_WINDOW_RETRY, 0.06)

Agent.SetOption (OPT_KEYBOARD_DELAY, 0.3)

.....

.....

For few options you can set in your script.....If you are going to set more number of options, it is better to set in an .opt file and use that .opt file....

The above example is for Agent option....There are other options e,g General, Runtime etc which you have to set in the .opt file

 194 views

63⟩ Can anybody explain me, where does logs get stored for an activity performed in Silktest?

Answer1:

Following command will export the log in text format.

"c:program filesseguesilktestpartner.exe" -complog "c:logs.txt"

-resextract -r "C:sample.pln"

Answer2:

By default, Silk doesn't create log files, it create a .res files. They are binary files and .log giles are usually text files.

However if you call partner.exe from the command line with the -resextract it will create a copy of the .res file as .txt.

These files are created in the directory where the .t file or .pln file that is executed are located.

 215 views

65⟩ Is there a way to handle this type of issue?

When click a link the new page(either same browser window or new) that opens doesnot load completely...meaning...the progress bar would stop to progress as shown in the attachment.....Finally the application would timeout after 180 seconds.

One work around for this is to increase the application timeout and wait longer. Can someone suggest a better workaround? Is there a way to handle this type of issue...

Try with browser.StopLoading ( ).....The method works by clicking the Stop button on the tool bar. When the browser is not responding(progress bar stops moving), use a Browser.ForceReady(True) to interact with the Browser and after performign necessary actions(In our case browser.StopLoading ( )..) use Browser.ForceReady(False)

 215 views

66⟩ I want to select sub menu -< what shuld I use ?

I am using function PopupSelect() for selecting popup menu item. But it selects main menu only .

I want to select sub menu -< what shuld I use ?

Ex

Window.PopupSelect(xPos, yPos, "File")

and now File menu contains sub menu lets say "NEW" How can I select that ?

Here I am using PopupSelect Function for TreeView.

*************************************************************

Here suppose I want to Select "New" Submenu from File Main Menu

use "/" character for submenu.

"#" character is used only when u passed SubMenu Index

*************************************************************

// For SubMenu Menu

sMenu = "File/New"

Window.PopupSelect(x,y,sMenu)

// For SubMenu Index

sMenu = "File/#1"

Window.PopupSelect(x,y,sMenu)

 193 views

67⟩ I want to remove printing of this script of the test case in result window. How can I do this?

In the Result Window page once after case is passed, along with the Results what I am printing, script inside the test case is also printing line by line.

I want to remove printing of this script of the test case in result window. How can I do this?

Answer1:

In Option --^gt; Runtime dialogue Box, at the result section there are several check boxes....Depending on your selection result is generated..... Check/Uncheck the boxes as per your need.....

To be more specific; In Option -> Runtime dialog ; uncheck 'Print agent calls' and 'Print tags with agent calls' under the head 'Debugging'

Answer1:

Execute the test plan:

"C:Program FilesSegueSilkTestpartner.exe" -q -resextract -r

"C:BVTBuild Verification Test.pln"

This creates a binary results file called Build Verification Test.res and a text results file Build Verification Test.txt.

Then from the batch file that called the script I make a call to head head -n1 "c:BVTBuild Verification Test.txt" > "c:BVTBuild Verification Test Summary.txt"

That gets me the first line, (Pass/Fail) I could make the -n switch larger to get all of the elements.

I then use a product called blat to e-mail that summary to my inbox along with the entire results as an attachment.

This way I don't have to print the results at all.

The version of head I use is part of cygwin. Here's where you get blat http://www.blat.net/

Note: What is Blat?

Blat is a Win32 command line utility that sends eMail using SMTP or post to usenet using NNTP.

 218 views

68⟩ Expain about data driven testing using silktest

1) Create an .xls containing the data required in the script such as username and password for this example

2) In Silk select Workflow -> Data Driven

3) Select Data Driven Test Case (after you create your testcase) Following the wizard browsing to the .xls file containing your data when prompted. This creates the DSN automatically for you. Accept rest of defaults barring you required naming conventions

4) In you script then code your method as say for example:

[CODE]

testcase DataDrivenExample () appstate DefaultBaseState

[ ]

[ ] Browser.Maximize()

[ ]

[ ] // If the Logon page is not displayed Load it.

[-] if (!LoginPage.Exists())

[ ] Browser.LoadPage("{kProtocol}://{kWebServer}:{kPort}/logon.jsp")

[ ]

[ ] LoginPage.LoginUser (User, Password)

[ ] ApplicationHome.Exists(kPageTimeOut)

[ ] ApplicationHome.SetActive()

[CODE}

Now highlight your variable User say first and from the column drop down list on the replace pan select your UserName column(that is been linked to your spreadsheet, this is all automatically done) and select Replace button, do the same for the rest of your required data. Notice the DATA DRIVEN ASSISTANT SECTION is automatically generatign code. This is a good way to start off anyways, hope it's been of some help, simple xls sheet attached but only expremely basic one

Below is what Code migth look like after Replace is selcted

[CODE]

testcase DataDrivenExample (REC_DATALIST_DD_DataDrivenExample rData) appstate DefaultBaseState

[ ]

[ ] Browser.Maximize()

[ ]

[ ] // If the Logon page is not displayed Load it.

[-] if (!LoginPage.Exists())

[ ] Browser.LoadPage("{kProtocol}://{kWebServer}:{kPort/logon.jsp")

[ ]

[ ] LoginPage.LoginUser (rData.recSheet1_.User, rData.recSheet1_.Password)

[ ] ApplicationHome.Exists(kPageTimeOut)

[ ] ApplicationHome.SetActive()

[CODE]

 196 views

69⟩ When I try to enable extensions for my browser i.e. IE, the following error occurs?

When I try to enable extensions for my browser i.e. IE, the following error occurs,

"Can't load helper qaphlpr.dll: The specified module could not be found."

My question is, does this mean that the SilkTest needs to be installed again or if there is any workaround.

Check whether the required dll is in the silk test installation folder.

 235 views

70⟩ Need to use the relative paths in my SilkTest Project. How to change the absolute paths to relative paths?

Need to use the relative paths in my SilkTest Project. How to change the absolute paths to relative paths. The purpose is that, when package the project, that package can be used on any other machine, irrespective of the paths defined, it should run on that machine too.

Answer1:

Say you have following organization of files

C:TestScriptScript.t

C:TestWDecWDec.inc

Now in Scrpt.t file to include WDec.inc, code following

1. use " C:TestWDecWDec.inc" --> Absolute

OR

2. use "..WDecWDec.inc" --> Relative [Move one level up from Script folder, then go to WDec folder]

Answer2:

I think if you work with Silk Project, it offers you some out of the box solution for this. If your suite is not implemented as a project, the best option is to use relative path in the Runtime options dialogbox, with the Root of the suite hardcoded.

i.e. Use Path = S:Suite << S maps to root of the automation suite

and use files are relative .i.e. frame.inc, ..configconfig.inc etc etc,

 235 views

71⟩ How to sort List of List of String?

[+] testcase test() appstate none

[ ]

[ ] LIST OF LIST OF STRING llsStr =

{{"1234","A"},{"2242","B"},{"2234","C"}}

[ ] Print(Sort(llsStr))

[+] LIST OF LIST OF STRING Sort (LIST OF LIST OF STRING llsStr)

[ ]

[ ] LIST OF STRING lsStr

[ ] INTEGER i, j , k

[ ] k = ListCount(llsStr)

[+] for (i=1;i <= k;i++)

[+] for (j=i+1; j<=k; j++)

[+] if val(llsStr[i][1]) > val (llsStr[j][1])

[ ] lsStr = llsStr[j]

[ ] llsStr[j] = llsStr[i]

[ ] llsStr[i] = lsStr

[ ]

[ ]

[ ] return llsStr

 205 views

72⟩ I am trying to run a remote application in Windows 2003. But everytime time I am getting the following error

I'm trying to run a remote application in Windows 2003. But everytime time I'm getting the following error:

"*** Error: Bad channel to agent call" .

My host and agent machine is running on Windows 2003. I have changed the network option for both Host and Agent machine as TCP/IP and port no 2965. Along with that, I have also changed the Agent Name in the Runtime options by Agent machine IP address and network as TCP/IP. Along with that I have also enabled all the relevent extensions.

If any one can let me know whether I have missed out anything in the configuration or do I need to do something else also. Also has any one came accross this kind of error (marked in red) previously.

Trying to use remote recording and play facility provided by Silk, for the same, agentname/ipaddress of the system, where remote agent needs to be used, should be entrered in the host machine's runtime options.

Use Connect () to connect to the target machine....After you connect to the target, then you don't need the agent at m/c where host is installed....So at host place, agent is local or any thing else doesn't matter....If you don't use Connect (), then you have to mention the remote agent name at the host runtime option...[I think so but I haven't tried this]....Now let us come to remote machine....Here even if you don't have the host installed (only Agent installed) your script would run....The host at remote machine is not used and therefore the settings made on the remote host are irrelevant...Only remote agent is used for interaction and the network should be enabled at remote agent...

If you use "local" in agent-options, recording and playback would be done locally i.e silk host would use local agent to do this thing. But if you use "ipaddress:port", the same would instruct silk-host to use remote agent for record and playback..or simply any activity.

Here is a sample code which runs successfully invokes the notepad at remote m/c [192.168.240.102 <http://192.168.240.102> ] and closes it

[ ] const wMainWindow = Notepad

[ ]

[-] window MainWin Notepad

[ ] tag "*Notepad*"

[ ]

[ ] const sCmdLine = "C:WINNTsystem32NOTEPAD.EXE"

[ ]

[-] main ()

[ ]

[ ] Connect ("192.168.240.102 ")

[ ]

[ ] Notepad.Invoke ()

[ ] Sleep (2)

[ ]

[-] if Notepad.Exists ()

[ ] Print ("Notepad invoked at remote")

[ ] Notepad.SetActive ()

[ ] Notepad.TypeKeys ("<Alt-F4>")

[ ] Sleep (2)

[-] else

[ ] LogError ("Notepad not invoked")

 217 views

73⟩ How to down load latest silk test trial version?

You don't as there are no free downloadable SilkTest trial versions. You must contact Segue sales and they will set you up with an account after you can demonstrate both need and desire to purchase, or at least evaluate. You then download SilkTest using that account.

 200 views

74⟩ How to change the absolute paths to relative paths?

Need to use the relative paths in my SilkTest Project. How to change the absolute paths to relative paths? (Note:The purpose is that, when package the project, that package can be used on any other machine, irrespective of the paths defined, it should run on that machine too.)

Silk Projectoffers you some out of the box solution for this. If your suite is not implemented as a project, the best option is to use relative path in the Runtime options dialogbox, with the Root of the suite hardcoded.

i.e. Use Path = S:Suite << S maps to root of the automation suite

and use files are relative .i.e. frame.inc, ..configconfig.inc etc etc,

 207 views

76⟩ How do I declare the tag, so that SilkTest recognizes only the beginnig of the text?

1. Try to declare the tag with prior text.

2. Try to declare the tag with location ... meaning #3 (This mean that this is the 3rd dynamic text in the page).

3. You can try to GetText ()

Note: As you know you can declare a tag in 5 different ways:

example:

Prior text : ^Foo

Location (relative to the page): #3

The exact text: (And you don't need to do this if the text is changing all the time)

Location (co-ordinates): and again this is not a good one to use.

 238 views

77⟩ My requiremtn is to click a link in the web based application?

My requiremtn is to click a link in the web based application.I have written a method to click the Java Script link.but it is giving the Window is not exposed Error.

I tried to solve with the following silk options .

[ ] Agent.SetOption(OPT_VERIFY_EXPOSED, FALSE)

[ ] window.ClearForm.SetFocus()

[ ] window.ClickClearForm()

[ ] Agent.SetOption(OPT_VERIFY_EXPOSED, TRUE)

It is giving the same error.

try the following code

[ ] Agent.SetOption(OPT_VERIFY_EXPOSED, FALSE)

[ ] Agent.SetOption(OPT_VERIFY_ENABLED, FALSE)

[ ] window.ClearForm.SetFocus()

[ ] window.ClickClearForm()

[ ] Agent.SetOption(OPT_VERIFY_ENABLED, TRUE)

[ ] Agent.SetOption(OPT_VERIFY_EXPOSED, TRUE)

 200 views

78⟩ For automating a web based application using JSP

For automating a web based application using JSP, there is a search textbox, a "Search" button, a listbox, a "OK" button, and a "Cancel" button. The "OK" button remains disabled by default. I need to enter a value in search textbox, click on search button, select the resultant value in the listbox and then the "OK" button is enabled.

Problem: When all this is automated, Silktest finds the OK button still disabled after selecting the resultant value, though the button is enabled.

Put one statement before clicking on save button

BrowserPage.flushcache()

 200 views

79⟩ Runtime Error in Silk?

It may be programming error, since DB next is used to go the next data in the table , may be it is getting to the last value, and not getting any value there.

 205 views

80⟩ How to create and edit a testplan?

1. Make sure your project is open.

2. Click the Files tab in the Project Explorer.

3. Right-click the Plan folder.

4. Click New File.

5. An untitled testplan file opens in the SilkTest testplan editor.

6. Click File/Save menu to save the testplan.

 200 views