Showing posts with label browser. Show all posts
Showing posts with label browser. Show all posts

SilkTest Question 54: Links not being recognized

The Quality Assurance Engineer tries to created fancy 4test script for newest version of web based application, but for some weird reason SilkTest 2006 is not recognizing links as HtmlLink objects.

The cause of this behavior is that someone have configured browser not to underline links (by default IE displays all links as underlined links). SilkTest 2006 requires that links be underlined. Reconfigure the browser on test machine to display links underlined.

SilkTest Question 53: How to fix unable to start Internet Explorer error?

The following error "Unable to start Internet Explorer 7" may suddenly appear while QA Engineer trying to record or run a test case. Usually this issue happens with freshly installed instance of Silk Test because the extensions enabled in the Extensions Enabler and Options/Extensions do not match the default browser.

QA Engineer need to carefully examine the settings for default browser on test computers and make them consistent with the settings for the host machine in Options/Extensions and for the target machine in the Extension Enabler.

SilkTest Question 43: How to count the number of open browsers?

Let’s assume that interviewer for Software Quality Assurance Engineer position wants you to implement the function for counting number of browsers which he recently opened on his/her computer. No one knows the real need for such function, because average tester prefers to work just with one browser and as a part of test case preparation would close all remaining Internet Explorers or Firefoxes. The first question to ask is what type of browser do you want to check and after meaningful answer you can create something like following function written in 4test language which returns the required number for Internet Explorer.


integer GetBrowserCount ()
integer browsers = 1
while (MainWin ("$explorer6_DOM[{browsers}]").Exists ())
browsers ++
return (browsers -1)

SilkTest Question 36: How to open and close browser?

There is Invoke method declared for the Browser window. The following 4test code invokes the currently defined browser - Browser.Invoke(). The Close method will close current browser windows – Browser.Close(), but in most cases this method can be used in combination with CloseOthers. The CloseOthers closes all instances of the current browser except the top most one. One more method would be useful for testing FireFox with SilkTest. The CloseOtherTabs closes all instances of the current browser tabs expect the left most one.

The 4test language examples:
Browser.Invoke()
Browser.Close()
Browser.CloseOthers()
Broswer.CloseOtherTabs()

SilkTest Question 27: How to set correct browser extension for web based application?

The following steps describes setting browser extension for testing web based applications.

  • Start SilkTest application.
  • Start Internet Explorer browser
  • Enter the URL of the Web application into Internet Explorer address bar and leave the Internet Explorer window with the web based application. Do not minimize browser window!
  • Switch back to SilkTest window.
  • Select Workflow->Basic in SilkTest menu
  • Press Enable Extensions on the Workflow bar.
  • The Enable Extensions dialog will show up. In most cases the web based application running in the browser window will be listed in the dialog box.
  • Select your web based application and click select.
  • The Extension Settings modal dialog window will show up. Select radio button DOM and click OK to enable the DOM browser extension.
  • Restart your web based application as asked in Text Extension Setting window and press Test button.
  • The SilkTest window with text "Configuration of your Internet Explorer 6 application is complete" should appear in case of successful settings.

SilkTest Question 25: How to fix the explorer6_Dom[1] error?

We have a few test scripts written by outsourced QA team in 4test language for regression testing of our web based application. During test script execution the error message ***Error: Window '[MainWin]$explorer6_Dom[1]' was not found appears. The problem is that the error message above is not shown every time when I run script, sometimes the code runs just fine, but it may happen that if I execute testing again the DOM error message appears. Not a single engineer in our QA team is able to find answer in SilkTest documentation. We asked for help from outsourced testing team, but they do not have any clue at all.

One of the solutions to fix *** Error: Window '[MainWin]$explorer6_DOM[1]' was not found is to verify that "Enable Third Party Browser Extensions" option of Internet Explorer is checked. You can find it under Tools/Internet Options/Advanced
Do not forget to reboot your computer after enabling this options.

SilkTest Question 23: How to set up proxy setting with 4test code?

In preparation for QA interview I try to develop script for setting up proxy server for Internet Explorer 6.0. So far I found two windows registry keys where proxy data are located on my Microsoft Windows XP testing machine.

I may turn proxy server on or off with 1 or 0 modifying
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable

I may define proxy server ip and port modifying
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer

What to do next?


The code below contain Silk Test code for turning on specified proxy server and as your home work for QA interview you can easily modify script for turning off proxy server. By the way before you change the registry, make sure to back it up and make sure that you or someone else in your company know how to restore the registry if a problem occurs or play with this script only on test environment.

[ ] // Turns on specified proxy
[ ] // sProxyName -> ip:port
[+] configureProxyServer(STRING sProxyName)
[ ]
[ ] integer iKey = HKEY_CURRENT_USER
[ ] string sPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\"
[ ] string sProxyServer = "ProxyServer"
[ ] string sProxyEnable = "ProxyEnable"
[ ] string sProxyOn = "REG_DWORD: 0x00000001"
[-] do
[ ] SYS_GetRegistryValue(iKey, sPath, sProxyServer, TRUE)
[ ] SYS_SetRegistryValue(iKey, sPath, sProxyServer, sProxyName)
[-] except
[ ] Reg_CreateValue(iKey, sPath, sProxyServer, serverName)
[ ]
[-] do
[ ] SYS_GetRegistryValue(iKey, sPath, sProxyServer, TRUE)
[ ] SYS_SetRegistryValue(iKey, sPath, sProxyEnable, sProxyOn)
[-] except
[ ] Reg_CreateValue(iKey, sPath, sProxyEnable, sProxyOn)
[ ]
[ ]

Silktest Question 16: How to delete cookies files using the 4test language?

I created a 4test script to test our web based application and would like to know how to delete a specific cookie file during script execution?


The following 4test function can be used for deleting specific cookie file:

[-] RemoveCookies (String sPath, String sFile)
[ ] //*******************
[ ] //* The function for removing a stored web cookie file.
[ ] //* sPath The complete path to the directory where the cookie is stored
[ ] //* Example "C:\Documents and Settings\Administrator\Cookies\"
[ ] //* sFile unique part of the cookie file name
[ ] //* for example "*winrunner*"
[ ] //*******************
[ ] LIST OF FILEINFO lfInfo
[ ] LIST OF STRING lsFileName
[ ] INTEGER iCount
[ ] STRING sLFile
[ ] Boolean bFound
[ ]
[ ] lfInfo = SYS_GetDirContents (sPath) //obtain directory content
[-] for iCount = 1 to ListCount(lfInfo) //for every FILEINFO in lsInfo
[ ] ListAppend(lsFileName, lfInfo[iCount].sName) //append the name of the files
[ ]
[-] for each sLFile in lsFileName //for each file name in lsFileName
[ ] bFound = MatchStr (sFile, sLFile) //check if the sFile string is in the File Names
[-] if bFound == TRUE //if the sFile string is in file name
[ ] SYS_RemoveFile (sPath + sLFile) //delete the file from the sPath directory
[ ]

You can easily modify this 4test function to remove all files in the particular directory or within a loop delete a list of files.

Silktest Question 2 : SilkTest recognises Internet Explorer as a Client/Server Application

After enabling the extension by tools/extensions for browser, SilkTest shows browser as a client-server application and the following message appears

SilkTest detected a Client/Server application.
The required Extension has been enabled.

There is only one solution for this problem with SilkTest testing tool. You have to recreate your windows user profile on the machine: Login as administrator, go to the User Profiles tool from the Advanced tab of the System Properties dialog box. Once you do, select your user profile from the list and click the Delete button. Log on again as you and this will create a new user profile.

P.S. If you want to save information from the profile, save that information individually i.e. if the you want to save your favorites copy the favorites to an other location and after deleting the profile copy the favorites back.

Silktest Question 1 : SilkTest does not set DefaultBaseState for Internet Explorer

The error message from the results file shows:
[ ] *** DefaultBaseState is invoking Browser
[ ] *** Error: Unable to start Internet Explorer 6 DOM
[ ] Occurred in AppError
[ ] Called from Explorer.Invoke at extend\explorer.inc(470)
[ ] Called from Browser.Invoke at browser.inc(361)
[ ] Called from DefaultBaseState at defaults.inc(126)
[ ] Called from main at $ScriptMain(2)


First check to ensure that all of the extensions have been enabled properly within SilkTest. If this is fine, then ensure that there are not two versions of SilkTest installed on the machine.

If there are not two versions of SilkTest on the machine then there is the possibility that the machine was not restarted when uninstalling the older version of SilkTest prior to installing the new version.

In this case perform the following:

Uninstall SilkTest,
Restart the machine,
Reinstall SilkTest,
Restart the machine.

SilkTest interview questions for QA Testers