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

21⟩ Prob regarding close the Child Window

Answer1:

1. Identify the process handle and

2. kill it First child and then the MainWindow.

Answer2:

Integer HWnd=Browser.GetHandle() ///before child popup opens

....then your code

While Browser2.Exists()

{

If Browser.GetHandle()!=HWnd

Browser.Close()

Else

Browser2.SetActive()

}

You can also use window caption in the former code.

Answer3:

I think the tag to identify the parent and child are not unique, that is why the parent is closed...try to make the window id unique and then close the page...

First activate the child using and then close....It should work....

 251 views

22⟩ I am investigating solutions for automating an Invisible Application and believe that using a Grid may solve many of my problems. Does anyone have any experience using this technique with Silk Test or know of any good resources I could contact.?

Answer1:

If you use QA Partner, you should know, what to work it is possible only with one application, because include file (xxxxx.inc) only one. You can work it is possible with different windows, but only from one application.

Answer2:

As far as the QA Partner list - I would say it is dead. The SilkTest list at Onelist.com (this list) is much better anyway, since all the messages are archived for people to go back and search on. Plus, each user can control how they want it - each message or in digest mode.

Answer3:

As I know, you can work with several applications simultaneuosly. QA Partner/SilkTest doesn't limit you from that. You can run into the problem with using the default recovery system for all applications under test, but this problem can be solved too.

 224 views

23⟩ Retrieve text from disable textfield.Silk is not recognizing that disable object. How can I come to a conclusion?

Retrieve text from disable textfield.Silk is not recognizing that disable object. How can I come to a conclusion? I am having a web based application. In one web page there is a radio button.Selection of that radio button open an applet window. Now if I want to take the declaration of that window, It fails to recognise the same.Silk is properly configured to recognise Java based CS application.How to resolve such issues?

If you want to retrieve data from a disabled textfield, you should first disable the Agent option "OPT_VERIFY_ENABLED" and the you can use GetText. The steps are:

Agent.SetOptions("OPT_VERIFY_ENABLED", false)

Print(TextField.GetText())

And coming to your next question, the answer is same, disable all the Agent options. Steps:

1.In the Options menu, click on Agent menu item.

2. In Agent Options window, click on Verification tab.

3. Uncheck all the options, except the last one (verification of application ready)

4. Click OK.

 273 views

24⟩ What are testplan attributes?

Testplan attributes are user defined characteristics to be associated with test group descriptions and/or test descriptions. You search, identify, and/or report test cases based on values of the different attributes.

 246 views

26⟩ Problem with JavaJFCTable class.

[I am trying to fetch values from a JavaJFCTable. I tried using GetContents, GetSelText, etc functions to retrieve values fromr the table but every time garbage values are retrieved. Has anyone faced such a problem before?

the application is recognized properly with no Custom objects in it.]

 231 views

27⟩ How to write function in inc file?

After you wrote the functions in inc ( eg:- demo.inc) you need to specify them in Use path/Use File

In Silk Test-> Options-> Run time

Specify the inc file path/File name in "Use File" Text box

(or)

Secify the file Path in "Use Path" and added the file name in "Use File" text box

(or)

In your script file add code like

[] use "demo.inc"

and add the inc file path in Silk Test-> Options-> Run time -> Use Path

 267 views

28⟩ How to record a test case?

1. Run SilkTest.

2. Click Option/Runtime menu. The Runtime Options dialog box shows up.

3. Edit the Use Files field to include your test frame file and the exlorer.inc file. For example: ...HomeFrame.inc,extendexplorer.inc.

4. Make sure IE 5.x DOM is selceted.

5. Click OK to cloase the Runtime Optoins dialog box.

6. Open your test project.

7. Click Record/Testcase menu. The Record Testcase dialog box shows up.

8. Name your test case. For example: LoginTest.

9. Select DefaultBaseState in the Applicatin State dropdown list.

10. Click Start Recording button.The Record Testcase dialog closes. Your Web application is will be automatically started by SilkTest, based on the information in test frame file. SilkTest Editor window closes. The Record Status dialog box shows up.

11. Continue to use your Web application. SilkTest records everything you did on your application.

12. Click the "Done" button on the Recording Status dialog box to stop recording. The Recording Status dialog box closes. The Record Testcase dialog box shows up again.

13. Click Paste to Editor. SilkTest will insert the recorded acitivities as 4Test statements into a script file. The Record Testcase dialog closes.

14. Click File/Save menu to save the script file. You can enter a script file name. For example, LoginTest.t.

 239 views

29⟩ How to write a Masterplan?

[I want many plans and testcases to run by a single file. As Master plan-Sub plan are good medium since it gives me sharing features. Can anybody tell me how to run sub plans from the masterplan with an example.]

Yaa, you can run all your sub-plans using master plan approach.

You just open new plan file and call your subplan/testcase from this file.

if you want to run subplan from master plan then sysntax is like

include: mysubplan.pln

 260 views

30⟩ How to maintain global variable when script is run thru test plans?

Answer1:

This is the feature of Silk Test.

When u declare some global variables and initialize them in a testcase in one .t file, they are not retained to be used in another .t file in a testplan.

Here is the way out ...

Create a file and save the values in this file before u exit from the .t file.

This can be your last testcase in a file.

In the next .t file in the sequence, read this file and initialize global variables again.

This can be your first testcase in the .t file.

Answer2:

try couple of things

1. use environment variable as suggested by an other member of this group

2. copy the variable to the clipboard, every automation tool has a way to write and read content from clipboard which does not effect scope of the script.

Answer3:

I have one more solution for this problem try it out.

External file method (preferably .ini file - use ReadIni (), WriteIni () and few other functions).

Override your TestcaseEnter () and TestCaseExit () functions to get and set variable (reading values should be in called TestCaseEnter () and writing back the values in TestCaseExit ())

Even testcase failure also you will not loose the values

 236 views

31⟩ How can we get the IP address of a PC?

You can use the following

main

[ ] INTEGER iReturn

[ ] STRING sCmdLine = "ipconfig"

[ ] LIST OF STRING lsOutput

[ ] iReturn = SYS_Execute (sCmdLine , lsOutput)

[ ] listprint(lsOutput)

output is

[ ] Windows IP Configuration

[ ] Ethernet adapter Local Area Connection:

[ ] Connection-specific DNS Suffix . : abcd.xyz.net

[ ] IP Address. . . . . . . . . . . . : 1x.2xx.2xx.79

[ ] Subnet Mask . . . . . . . . . . . : 255.255.0.

[ ]Default Gateway . . . . . . . . . : 10.206.1.1

You need to do some trickery to parse and get the IP string..

 222 views

32⟩ Problem with the VerifyBitmap

Using VerifyBitmap function for comparing the Position, Borders, Color etc.

For Example:

Window.VerifyBitmap("Position.bmp",[Rect])

Window.VerifyBitmap("Border.bmp",[Rect])

Window.VerifyBitmap("Color.bmp",[Rect])

Running the script if any one of the verification failed, script is terminating at that point itself, without running remaining lines in the script.

Is it possible to make script run completely even though any of the verification failed? Want to see all the failed verified results in result window.

Answer1:

Put all the verification statements in individual do...except.....You can keep except part blank or display your error message here.....

Answer2:

That is how below three functions will work.

VerifyBitmap()

VerifyProperties ()

Verify ()

that should be last statement of your testcase and cleanup code you put after that but, that will get executed only when testcase pass. You can put it in except block so that it will get executed even testcase fails also Like below

do

//

//

//your statements

//

//

VerifyBitmap()

except

// your remaining statements those need to be executed only when testcase fails.

Or

use SYS_CompareBitmap() instead of VerifyBitmap()

 233 views

33⟩ How to link an error in the result file to the script file?

1. Make sure the Result window is open with result file.

2. Click Results/Pass/Fail Report. The Pass/Fail Report dialog box shows up.

3. Select an attribute on which you want the report to be based on. For example: Component.

4. Click the Generate button.

5. SilkTest generates a report in the Pass/Fail Report dialog box.

6. You can print or export the report.

7. Click the Close button to close the Pass/Fail Report dialog box.

 251 views

34⟩ What are the functions offered by DBTester?

DBTester offers 6 functions. You can use them directly in your test cases:

1. DB_Connect: Opens a database connection linking the data through the specified OBDC DSN name. DB_Connect returns a connection handle which can be used on other DBTester functions. SQL statements can be submitted to the database. For example: con = DB_Connect("dsn=dsn_name")

2. DB_Disconnect: Closes the database connection represented by the speficied connection handle. All resources related to this connect are also released. For example: DB_Disconnect(con)

3. DB_ExecuteSql: Sends the specified SQL statement to the specified database connection for execution. DB_ExecuteSql returns a query result handler which can be used by the DB_FetchNext function. For example: res = DB_ExecuteSql(con, "SELECT * FROM ...")

4. DB_FetchNext: Retrieves the next row from the specified query result handler. For example: DB_FetchNext(res, col1, col2, col3, ...)

5. DB_FetchPrevious: Retrieves the previous row from the specified query result handler.

6. DB_FinishSql: Closes the specified query result handler. For example: DB_FinishSql(res)

 221 views

35⟩ Need help to create Frame Work with Web testing 1) Should I do window declaration for each page 2) Should I do window declaration with multiple tag 3) Which multitag should I choose?

Anwser 1:

1) Should I do window declaration for each page Not necessarily but in most probability, u will have to do it. However, you don't need to declare every object in every page. You need to make use of inheritance so that an object declared in main class can be inherited to sub classes.

2) Should I do window declaration with multiple tag You can use multi tag to declare windows. When I say multi, you can use different captions of the window.

3) Which multitag should I choose Caption

From my experience, this multi tag should be WindowID.

Let me explain,

If you have two instances of the same application running, (obviously, both will have same caption), a conflict arises. In such a situation, Silk Test script fails.

To avoid this condition, Window ID can be used, because, even if two instances are running at a time, the window ID's would still be unique.

Anwser 2:

For Web based windows, dialogs, Window IDs are not much useful. Now silktest is identifying the object's variable name in source code. It will be similar to window ID. For stand alone applications, Win ID will be useful. Even if you look into silktest's INC files, you can see window ID.

While coming to duplicates of windows, then you can use window location, index and window ID. Mostly people are using Index like calc[1],calc[2],#1 and #2. Rarely ID and location (points X&Y) are used. I'm using location to some of modal dialogboxes in our AUT.

 234 views

37⟩ GMO OnLine Trouble?

[I've already worked around the problem I'm having, but I'm curious know if anybody else has gotten this to work without a workaround.

This pertains to GMO Online.

I've tried using GMOW.inc which came with SilkTest 5.0, and that was after my own declaration had problems.

The problems are:

1- The SameAs checkbox is non checkable?

2- The Fields on the ShipTo side give me problems even if I try to use the GMOW.inc.

3- SetText for HtmlTextFields has problems, where it does not set text sometimes, and others it leaves some of the old chars in there (like 0).

Now for my workarounds:

1- Used Keyboard (Tabs and Space)

2- I've changed the declaration tags to Index 1st then Caption Second for all the ShipXXX and BillXXX fields.

3- I've Over-Ridden SetText to do it twice for HtmlTextField class.]

Yes, I have seen this problem from time to time. In class, I most often insert a Tab key in between each line. I have not seen this problem (to the best of my recollection) when running Netscape 4.07 on NT. I haven't found out why this is happening though (if it's due to the agent, the GMO app, or the environment).

 204 views

38⟩ SilkTest runtime does not always get control (focus) after a test?

On Windows 98 or Windows 2000, if SilkTest launches but will not fully exit after execution of tests (leaving a blinking "SilkTest" window on the task bar).

This is due to a problem with Windows. The directory "W98_2000" on your SilkTest installation CD includes a file that should prove helpful. To perform this fix manually, use RegEdit to modify the following key in the registry of the computer running SilkTest:

HKEY_CURRENT_USERControl PanelDesktop

"ForegroundLockTimeout"=dword:000003E8

 222 views

39⟩ What is a test frame?

A test frame is a file that contains information about the application you are testing. Information stored in a test frame will be used as references when SilkTest records and executes testcases. A test frame is stored in an include file with file extension .inc.

 222 views

40⟩ A problem with SilkTest seeing HTML Links as HTMLText?

A problem with SilkTest seeing HTML Links as HTMLText. This always happens when the link is within a table (which is inside a table, which is inside another table).

In some areas I found if I put a space between the <TD> tag and the anchor tag, SilkTest will read the link as an HTMLLink. However, this trick doesn't always works. Infact, it only works in about 20% of the cases.

Has anyone else encountered this? Anyone know of a workaround?

Is there anything you want to do with these links that you cannot do now?

Even if they are recognized as Text, can't you do almost anything you can do on a link. Example Click () etc...

You can also choose to extend the HtmlText class to have the same methods as HtmlText.

 221 views