Written by Raj
51. GMO OnLine Trouble?
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).
52. How to define values for a testplan attribute?
You must define values for a testplan before using it:
- Make sure your test project is open.
- Click Testplan/Define Attributes menu. The Define Attributes dialog box shows up. You should see 3 predefined default attributes and other attributes defined by yourself.
- Select an attribute. For example, "Component". The Values box should be empty.
- Enter a value in Add box. For example, "Catalog".
- Click Add. Value "Catalog" should be inserted into the Values box.
- Repeat the last two steps to add more values
53. SilkTest runtime doesn't 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_USER\Control Panel\Desktop
"ForegroundLockTimeout"=dword:000003E8
54. Where are the testplan attributes stored?
Testplan attributes are stored in the testplan initialization file, testplan.ini, in SilkTest installation directory.
55. 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.
Testing a product with both web and non-web interfaces. testscripts to test both and has had trouble configuring Silk to do this. using Silk 2.1 and is wondering whether upgrading to Silk 5.0 might help?
Trying to automate the testing of both Web GUI and non web GUI at the same time. Meaning in the same testcase?
If not. Organizer: You can create 2 different .opt files (option files) one with the Web environment and the other without. In the organizer Can tell it which opt file to load before executing a specific testcase.
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.
56. How DOM browser extension identify a Web application UI object?
A Web application UI object is identified in two parts:
- Identify the Web browser window where the Web application is running. For example, a Web browser window can be identified as "Browser.BrowserChild("Yahoo Home Page")". Another Web browser window can be identified as "Browser.BrowserChild("Google Home Page")".
- Identify the Web UI object based on the HTML element that represents the UI object. For example, an image in a Web page can be identified as "HtmlImage("Yahoo Logo")"; A hyperlink in a Web page can be identified as "HtmlLink("Site Map")";
The full identification of a Web applicatin UI object is the concatenation of the browser window identification and the HTML element identification. For example, the Yahoo logo image is identified as: Browser.BrowserChild("Yahoo Home Page").HtmlImage("Yahoo Logo"). The site map link is identified as: Browser.BrowserChild("Google Home Page").HtmlLink("Site Map").
57. How silktest recognize objects in UI? What it intenally calls to find out that the particular UI element is of which class etc??
Silk recognizes a UI with the tag it assigns to the UI.....There are 5 tags, see silk help for them...Some of it are operating system specific......
Go to Silk-->Record-->Window declaration.......Move the mouse pointer to the object for which you want to know the class.......It is shown in the tree view in the record dialogue box....
You can also do by Silk-->Record-->Window Identifier .....
58. What is multi-tagging?
Multi-tagging is a technique used by the DOM browser extension to identify a Web page UI object. Whenever possible, DOM extension inserts more than one tag into the object identifier in following format:
Browser.BrowserChild
("page_title").html_class("caption_tag|#index_tag|window_tag")
- "caption_tag" is the caption of the HTML element.
- "#index_tag" is the index of this HTML element, counting from the beginning of this page of the same class of HTML elements.
- "window_tag" is the window identifier.
59. How to get the integer value from a string ?
How to get the integer value from a string
print([int]"100")
this returns some different value some 49
need the value 100 to be print
Answer1:
There is one inbuild Silk's function which converts String value into Integer. Try with that
INTEGER iTemp = Val ("100")
Answer2:
Use Val function.....
print (Val("100"))...The int wrapper returns the ASCII value for the string "100"....
60. How to specify a browser extension to a Web application?
- Run SilkTest.
- Open Internet Explorer (IE).
- Enter the URL of the Web application.
- Leave the IE window with the Web application. Don't minimize the IE window.
- To back to SilkTest window.
- Select Basic Workflow bar.
- Click Enable Externsions on the Workflow bar.
- The Enable Extensions dialog will show up. Your Web application running in the IE window will listed in the dialog box.
- Select your Web application and click Select.
- The Extension Settings dialog will show up. Click OK to enable the DOM browser extension.
61. An application developed using Dotnet. and 1000 cases recorded for this application. ......
An application developed using Dotnet. and 1000 cases recorded for this application.
All was working fine until...one fine day...
Some one changed the namespaces which are used by this application. The scripts have started failing because it is as good as having a new window or a panel in the application.
Obviously, Silk does not recongnise this window.
Now is there any way to tackle this problem other than recording the windows all over again.?
Answer1:
First capture few windows and compare the new window declarations with old ones.
And try to find what are the changes in tags (Names) and any layers between windows.
Accordingly you just need to modify the few window identifies and need to include additional windows if any. ( you need not to touch your 1000 testcases ). Long back I had same problem with this method I solved.
Answer2:
If you are very sure that only the namespace name change has impact on the scripts then I can suggest you one approach.
I am assuming the following, Suppose the previous namespace name is "x" & now it is "y". And all your scripts are in a single folder say "F"
You need to write a script in any language C# or our own 4T language, that need to search all through the folder "F" and replace all the "X" with "Y" in each and every file.
This is the general way I go ahead when need to update one object in n number of files.
62. How to test your DefaultBaseState?
- Close your Web application and other Web browsers.
- Make sure your test frame is open.
- Click Run/Application State menu. The Run Application State dialog box shows up with a list of states. One of them should be DefaultBaseState.
- Select DefaultBaseState.
- Click Run button. The Runtime Status dialog box shows up. And the Results File dialog box shows up too.
- You should see no error message in the results file.
63. I have a GUI similar to Find Dialogue Box in Notepad.....
Question 1: I have a GUI similar to Find Dialogue Box in Notepad..... Here the Check Box "Match Case" is recognized as Push Button and I want to check whether the check box has been checked or not..... I can not map a standard class "PushButton" to another class "CheckBox"....In the Window declaration I manually changed the PushButton class to CheckBox class but not working...
Please suggest any solution.....
Answer1: 1. Try to find the class of that object by using Window Identifier. Sometimes it already mapped.
2. If it is developed by VB or C++, try to use ActiveX properties.
Question 2:
I checked and the class is not mapped..... The application has been developed in C++.....can you share some information on how to use ActiveX properties using Silk....
Answer2:
I think, you have to add your application in the extension enabler and check ActiveX Properties. See the help for " ActiveX: enabling support for"
64. What are the important aspects of a test case?
- Each test case must be independent of other test cases.
- Each test case have a single test purpose.
- Each test case should start from a base state and returning to the same base state.
65. WhaIs there a specific way to run a script from a point what I prefer, which is similar to run from cursor option in Winrunner.?
Any patch, adding, etcÂ… that enables this option in Silk.
I don't think run from cursor is available in Silk......In this case, I comment the lines above, change the appstate to none and run...
66. How to include a test case into a testplan?
- Make sure your testplan is open.
- Enter a test description into your testplan. For example, "Test login process".
- Select this test description.
- Click Testplan/Detail menu. The Testplan Detail dialog box shows up.
- Click the Test Execution tag on the Testplan Detail dialog box.
- Click the "Scripts" button to browse and select a test case script file. For example, LoginTest.t.
- Click the "Testcases" button, to select a testcase recored in the specified script file.
- Click OK to close the Testplan Detail dialog box.
67. How to Setting Max value?
Here's the function you need to verify that an object (TextField) accepts a max char limit.
[code]
[+] boolean VerifyMaxChars (window wTarget, integer iMax, string sChar optional)
[ ]
[ ] string sText = ""
[ ] string sComp
[ ]
[+] if sChar == null
[ ]
[ ] sChar = "A"
[ ]
[ ]
[ ] sText = Replicate (sChar, iMax)
[ ]
[ ] wTarget.TypeKeys (sText)
[ ]
[ ] sComp = wTarget.GetText ()
[ ]
[+] if sText != sComp
[ ]
[ ] Verbose ("Verify Max Chars failed, expected number {iMax}, actual {Len (sComp)}")
[ ]
[ ] return false
[ ]
[ ]
[ ] sText = Replicate (sChar, iMax + 1)
[ ]
[ ] wTarget.SetText (sText)
[ ]
[ ] sComp = wTarget.GetText ()
[ ]
[+] if sText == sComp
[ ]
[ ] Verbose ("Verify Max Chars failed, expected number {iMax}, actual {iMax + 1}")
[ ]
[ ] return false
[ ]
[ ]
[ ] return true
[ ]
[/code]
68. How record a test case into a testplan automatically?
Test cases can recorded first without a testplan, then included into a testplan later. Test cases can also be recorded into a testplan directly:
- Make sure your testplan is open.
- Enter a test descripption into your testplan. For example, "Test change password".
- Select this test description.
- Click Record/Testcase menu.
- Enter a name for the script file.
- Click Open. The Record Testcase dialog box shows up.
- Enter a testcase name in the Testcase Name field.
- Select DefaultBaseState in the Applicatin State dropdown list.
- 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.
- Continue to use your Web application. SilkTest records everything you did on your application.
- 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.
- Click Paste to Editor. SilkTest will insert the recorded acitivities as 4Test statements into a script file. The Record Testcase dialog closes.
- Click File/Save menu to save the script file. You can enter a script file name. For example, ChangePasswordTest.t.
69. Can SilkTest switch browsers automatically?
You can, but there's a few steps that need to be done.
You need to use Organizer to do this. There you can re-run the same testcases but at the top open a different .opt (options) file. You have to save these 2 opt files though after you set the runtime with Netscape, save the 1st one and save another after you set it up with IE.
Read more about organizer to learn more.
70. How to run a test case from a testplan file?
If a testcase is linked to a testplan, you can run it from the testplan:
- Open the testplan.
- Select the test description line which has the testcase linked.
- Click Run/Testcase menu. The Run Testcase dialog box shows up.
- Click the Run button. SilkTest starts to run the test case.
- Do not touch mouse or keyboard, to avoid interrupting the test case execution.
- SilkTest finishes executing the testcase. The Restuls window shows up with the execution result.
- Review the execution result.
71. Is there a better way to generate a random integer than SilkTest's RandInt() function?
Is there a better way to generate a random integer than SilkTest's RandInt() function? I need true random numbers that going through a loop will give a diffrent random number each time. How RandInt does it is you get the same number on a fast loop.
I did make a RandomInt() function (see below), which helps on general random numbers since it is using RandSeed(), but on a loop that just grabs some random numbers, I still get the same numbers.
Anyone have a better way?
[CODE]
[ ] // Function: RandomInt
[ ] // Arguments: 1) iMin = Integer of Minimal value
[ ] // 2) iMax = Integer of maxium value
[ ] // Returns: random integer withing iMin and iMax
[-] INTEGER RandomInt(INTEGER iMin, INTEGER iMax, INTEGER iSeed optional)
[ ] INTEGER iRandom
[ ]
[-] if (iSeed == NULL)
[ ] iSeed = GetDateTimePart (GetDateTime (), DTP_SECOND) * GetDateTimePart (GetDateTime (), DTP_SECOND)
[ ]
[ ]
[ ] RandSeed (iSeed)
[ ] iRandom = RandInt(iMin, iMax)
[ ]
[-] if (DEBUG)
[ ] print ("Random Seed = {iSeed} Random Int = {iRandom}")
[ ]
[ ] return iRandom
[ ]
[/CODE]
Answer1:
Most programming languages provide random number based on what is called a pseudo-random sequence. This provides the appearance of random selection via a list that is seeded automatically by the system or by a command by the programmer. Either way it is still a randomized repeating list.
I don't know what to tell you except that you could try to reseed the generator after some number of iterations. the number of iterations could be randomized to vary the reseed interval. The seed could be based on a number representing the number of seconds (in integer form) since some fixed point in the past. This process probably would not repeat but sequences of integers could repeat unless the pseudo-random sequence is itself randomized by the seed instead of just the starting point within the sequence. I don't know the answer to that one. Otherwise your best hope might be a dll designed to provide a random number.
Answer2:
Try to have your function sleep a random time (1-3 seconds or so) and after the sleep call the RandInt () function.
You sort of call the RandInt twice one in each other. that doubles your Randomness chances.
72. How to run all test cases in a testplan?
- Open the testplan.
- Click Run/Run All Tests menu. SilkTest starts to run all the test cases in the testplan.
- Do not touch mouse or keyboard, to avoid interrupting the test case execution.
- SilkTest finishes executing the testcase. The Restuls window shows up with the execution result.
- Review the execution result.
73. How to select a group of test cases in a testplan to run?
Usually, a testplan contains a big number of test cases. For some reason, you don't want to run all test cases in the testplan. You want to select a group of test cases and run them:
- Open the testplan.
- Select the test description line (linked to the testcase) to mark.
- Click Testplan/Mark menu. The selected test description line is marked.
- Repeat this process to select more linked testcases.
- Click the Run/Run Marked Tests menu. SilkTest runs all the marked testcases.
- Do not touch mouse or keyboard, to avoid interrupting the test case execution.
- SilkTest finishes executing the testcase. The Restuls window shows up with the execution result.
- Review the execution result.
74. How to open an existing SilkTest project?
- Run SilkTest.
- Select File menu.
- Select Open Project.
- Select the project.
- Click OK.
- SilkTest will open the selected project.
75.How does Silk do with People Soft applications ...
Two questionsfor Web and Application testing (People Soft)
[(1) Can Silk concurently drive BOTH a web application and a People Soft Application. Assuming I do not use appstates.
(2) How does Silk do with People Soft applications. Anyone out there have any war stories (good and bad) about this? I know people soft employs SQA and only SQA for this type of testing.
(3) When I do record the few People soft apps (for subsequent programming of tests) the recording is very slow. Also there are frequent agent freeze ups during a record session. The only way around this has been to reboot my machine.
I do not have any specific knowledge of People Soft applications but if you can see object with the recorder there should not be to many differences to other mixed application test scripts.
1) Yes Silk can drive both a web application and another application(such as People Soft)
I would recommend creating frames in separate *.inc files and then commenting out the const wMainWindow variable on the secondary application (I suggest the People Soft app as you can then use the default browser settings to assist in setting default states). The wMainWindow indicates what application to use for base states. This allows you to use application states if you need to. You can modify the default state to also start up the People Soft application. I have written scripts to manage browsers and FTP clients. This was quite successfull. The FTP clients were not web based (CuteFTP).
2) I don't know the specifics about this one. If you can automatically identify all of your object or Class map them effectively there should not be any large problems with using Silk with People Soft Applications. Our company has its own product called OpenUI for GUI design and Silk performs fine with it. We map our OuiFrames to VBFrames and the remainder of the objects are identified correctly. We have had a couple of strange things (tags altering) but nothing that could not be identified and worked around. We have quite a large suit of test cases. If you can record the object on the screen and they are identified as Text fields, Windows, buttons etc correctly you should not experience any large problems using Silk with People Soft products.
3) The recorder freezing up is quite common for everyone (at least everyone I know). If you are on NT you should only have to log out and back in again. If on Win 95/98, yes you will need to reboot. It is a real pain. I am getting nervouse about demonstrating the recorder to prospective customers. The good news is that Segue is addressing this issue with the recorder as we speak so I assume it should be resolved in future releases. (I am not from Segue so this is not an official statement, just heared it on the grapevine.) The speed of the recorder should not be a long term problem as these types of tools are really not good past the inital development stages. The are too limited and dont structure the code correctly. I have had problems with speed particulary associated with the freezing. It seems to slow down to about one micro instruction a second which is very frustrating.
76. Where is a testplan stored?
A SilkTest testplan is stored in a file with .pln file extension.
Is this correct behavior for Silk or one of the idiosyncrasies of my non-standard windows ...
77. When I extended the delay I noticed that Silk is a bit bizarre in the way it selects a sub menu item. For example, if you're selecting the first sub menu off the first menu item Silk drops down the menu, highlights the last item then back to the top and finally selects the sub item. Is this correct behavior for Silk or one of the idiosyncrasies of my non-standard windows app?
Answer1:
If I recall correctly, this behavior is a symptom of having changed the "Events used to invoke popup menus" string in the Agent Options/Other tab. Its default value is set to an unintuitive "<Button 2><Up><Down>". However, if you change it to "<Button 2><Down><Up>" it will perform as you describe.
Answer2:
If you select Options->Agent, then select the "Other" tab, you'll see a couple of checkboxes: "Pick menus before getting menu item information" and "Pick dropdowns before getting menu item information". I'm guessing that you have these checked by the behaviour you are describing. If you uncheck them, Silk won't check all of the menuitems before it does the Pick().