Sunday, July 12, 2009

Top 10 Silktest blogs/forums

Earlier I have seen Dmitry Motevich's post 15 QTP sites/blogs/groups/forums. Similarly I have listed for Silktest.

  1. SQA Forums
    Initially it was QAForums. Many silktest users are participating here. You can find many silktest expertise in this forum. It is having more than 50k posts and sample code.
  2. Borland Support
    Tool vendor's support site. Recently borland made compulsory service contract to access Knowledgebase articles and silktest community. It has plenty of usefull KB articles.
  3. Silktest FAQ & Tips
    Great blog for Silktest FAQ and tips. It has detailed solutions for common silktest issues.
  4. Silktest and Automation Tips
    Here user can find Silktest tips, code and automation tricks. Also covering advanced features of Silktest.
  5. Silktest tips
    One more good blog with limited posts.
  6. Silktest Yahoo groups
    It is the only active Silktest yahoo groups. One can find many expertise here.
  7. Silktest Tutorial
    Having detailed tutorials for Silktest.
  8. Silktest on QACampus
    Few more Silktest information is shared here.
  9. Darshan's blog
    Contains mixed of silktest and python posts.
  10. CSDN blog
    Many posts are in Chinese language. Has covered most of the silktest features.


Also I would like to mention few popular silktest sites, which are not available now. Many of you would have seen Bret Pettichord's Software Testing Hotlist. But most of the Silktest links are not exist today. All of them having fundamental and advanced concepts of Silktest. Also they have shared 4test sample code and white-papers.

Jeff Hemsley-OOPs and Classes concepts
Non-exist Link: http://www.weirdness.org/jeff/articles/a_classes.html
Current Page: Classes, Objects, Dynamic Instantiation and Constructors: Is 4Test Really an Object-Oriented Language?

Tony Venditti's Silk Automation Page
Non-exist Link: http://www.iris.com/web/irisdevs.nsf/c404f3f7c0cc20458525618c00633c15/f41c9c2b9b8dc4508525666700747f56?OpenDocument
Info about him: IBM page

Silktest White Papers - ameliortech
Non-exist Link: http://www.ameliortech.com/stuff/toolkits/ST/st_whpap.htm

4Test Hints and Tips
Non-exist Link: http://www.testmap.com/4test/4test_support.htm

Automation Expertise Tutorials
Non-exist Link: http://www.automationexpertise.com/Tutorials/SilkOrganizer/pages/Parent.htm

Mr. Cluey's Kludge Page
Non-exist Link: http://www.sqa-test.com/mr_cluey/

Automation on Quality Tree website
Non-exist Link: http://www.qualitytree.com/autotest/qapartner.htm

Automation Junkies
Non-exist Link: http://www.automationjunkies.com/resources/experts.shtml

I think that I can put them here, If I am able to retrieve those missed pages from my storage or from others. What do you say?

Sunday, July 5, 2009

Silk4J Overview & Analysis

Silk4j was introduced from Silktest 2008. Hereafter user can use Java as test scripting language with the help of Silk4J Package. It is supported only with Open Agent. I hope that Borland might target developers too. User can write java unit tests as well as GUI tests.

From Silktest Help - Silk4J Eclipse Plugin

Silk4J enables user to create functional tests using the Java programming language. Silk4J provides a Java runtime library that includes test classes for all the classes that Silk4J supports for testing. This runtime library is compatible with JUnit, which means you can leverage the JUnit infrastructure and run and create tests using JUnit. You can also use all available Java libraries in your testcases.

The testing environments that Silk4J supports include:

  • Adobe Flex applications
  • Java SWT applications
  • Windows Presentation Foundation (WPF) applications
  • Windows API-based client/server applications
  • xBrowser applications


Silk4J with Open Agent - Google Search testcase

I have gone through documents such as Silk4J_QuickStartGuide_en.pdf and Silk4J_AdvancedUserGuide_en.pdf. I created the sample code and it works fine.

package com.palani;
import org.junit.Before;
import org.junit.Test;

import com.borland.silktest.jtf.Desktop;
import com.borland.silktest.jtf.TechDomain;
import com.borland.silktest.jtf.xbrowser.BrowserWindow;
import com.borland.silktest.jtf.xbrowser.DomButton;
import com.borland.silktest.jtf.xbrowser.DomTextField;

public class GoogleSearch {
private Desktop desktop = new Desktop();
private BrowserWindow browser;

@Before
public void setUp() throws Exception {

browser = (BrowserWindow)desktop.executeBaseState(
"C:/Program Files/Internet Explorer/iexplore.exe", null, null,
".//BrowserWindow", TechDomain.XBROWSER);
browser.navigate("http://www.google.co.in/");
}

@Test
public void testSimpleGoogleSearch() throws Exception {

DomTextField searchText = (DomTextField)browser.find (".//DomTextField[@title='Google Search' and @name='q']");
searchText.setText("");
searchText.setText("silk4j tutorial");
DomButton btn = (DomButton)browser.find(
".//DomButton[@type='submit' and @name='btnG']");
btn.click();
}
}


4Test with Open Agent - Google Search testcase
The same case is written in 4Test. SilkTest supports a subset of the XPath query language. It gives dynamic object recognition.

[ ]
[-] testcase GoogleSearch1 () appstate none //DefaultBaseState
[ ] STRING sUrl="http://www.google.co.in/"
[ ]
[-] if (! InternetExplorer.Exists(2))
[ ] InternetExplorer.Invoke ()
[ ] InternetExplorer.SetActive ()
[ ] InternetExplorer.Maximize ()
[ ]
[ ] WINDOW wMain = Desktop.Find(".//BrowserApplication")
[ ] WINDOW wBrowser = wMain.Find(".//BrowserWindow")
[ ]
[ ] wMain.SetActive()
[ ] wBrowser.Navigate (sUrl)
[ ] WINDOW wText1=wBrowser.Find(".//DomTextField[@title='Google Search' and @name='q']")
[ ] wText1.SetText("Silk4j Tutorial")
[ ] wBrowser.Find(".//DomButton[@name='btnG' ]").Click ()
[ ]
[ ] WINDOW wText2=wBrowser.Find(".//DomTextField[@name='q']")
[ ] wText2.SetText("Silktest Extension Kit")
[ ] wBrowser.Find(".//DomButton[@name='btnG' ]").Click ()
[ ]
[ ]


Selenium RC Java format - Google Search testcase

Selenium is a open source tool and can be used only web based applications. But user can choose different languages to develop the suite. Selenium tests can be written with Selenese, PHP, Perl, Python, Ruby, DotNet and Java.

import org.openqa.selenium.server.SeleniumServerTest;
import com.thoughtworks.selenium.*;
import junit.framework.*;
import org.openqa.selenium.server.SeleniumServer;

public class TestSearch extends SeleniumServerTest {
private Selenium browser;
public void setUp() throws Exception {
SeleniumServer seleniumServer = new SeleniumServer();
browser = new DefaultSelenium("localhost", 5555, "*firefox", "http://www.google.com");
seleniumServer.start();
browser.start();
}

public void testGoogle() {
browser.open("/webhp?hl=en");
browser.type("q", "hello world");
browser.click("btnG");
browser.waitForPageToLoad("5000");
assertEquals("hello world - Google Search", browser.getTitle());
}

public void tearDown() {
browser.stop();
}
}


Few Questions

Now Silktest and selenium both supports in Java language. Silktest supports many type of applications. In other end, Selenium supports many Operating Systems and browsers. I have few questions on Silk4J.
  1. Can Silk4J utilize silktest features such as TestcaseEnter,TestcaseExit,scriptEnter and ScriptExit?
  2. Target audience?
  3. Any Success stories (implementations)?

Saturday, June 27, 2009

Silktest Questions

Last two weeks, I was trying to compile all the silktest related questions. It helps me to dig, how much I know in Silktest. I have left out few areas. I did not cover much on the recent silktest features or additions. I have given just questions only not answers. For answers, you can try this blog - SilkTest FAQ and Technical Questions .

Silktest Basics

  1. What are the file types available in silktest and usage of that?
  2. What is the usage of SilkMeter?
  3. What is a SilkTest Agent?
  4. What is “appstate” in silk?
  5. What is the difference between appstate and testcase?
  6. What is the difference between testcase and function
  7. Can any testcase be called within another testcase?
  8. Can any testcase be called within function?
  9. How can you make shared variables in Silk?
  10. Tell me about options set file (*.opt)?
  11. What is 4test? Do you know about classic 4 test and Visual 4test?
  12. What is a test frame?
  13. Tell me silktest workflows?
  14. Where can you find all the methods for a class?
  15. What is test identifier and tag?
  16. What are the prefixes of every tag identifier while taking window declarations?
  17. If you want to record the mouse move event, then what you have to do?
  18. Explain Basic Workflow in silktest?
  19. Explain Data Driven flow in Silktest?
  20. Different types of tags and can we set the tag dynamically?
  21. What do you meant by Silk Extension?
  22. What are the different Variable pass-modes available and how will you use in scripting?
  23. How can you start one application?
  24. What do you mean by a DefaultBaseState and what role does it play in automated testing?
  25. When is the SilkTest Recovery System used?
  26. How can you run only the failed testcases in the second round of testing?
  27. How can you do database testing using silk?
  28. How will you implement immediate If statements?
  29. How silkAgent interacts with script statements?
  30. Description Equivalent to a function or method call.
  31. Array and List Declaration
  32. Can you give few of common silktest errors
  33. What are the different file opening modes available in silk?
  34. What is the difference between “Log Error”, “Log Warning”?
  35. What is the difference between “ExceptLog” and “LogError” function?
  36. How can you handle exceptions in silk?
  37. What is the difference between “raise” and “re raise” statements in silk?
  38. What are the uses of “Use Path” & “Use File” text field Silk’s option> runtime dialog box?
  39. What does it indicates “Agent.SetOption (OPT_APPREADY_TIMEOUT, 180)”?
  40. How can you identify each and every radio button under radio button group?
  41. What is extension enabler?
  42. How will you access Database, retrieve the records using Silktest? Is there any limitation?
  43. How do I add steps to DefaultBaseState?
  44. Can I call Silk Scripts from an external shell program?
  45. What are the default testplan attributes?
  46. How to define new testplan attributes?
  47. Where are the testplan attributes stored?
  48. How to assign attribute values to test cases?
  49. How to include a test case into a testplan?
  50. How record a test case into a testplan automatically?
  51. How to run all test cases in a testplan?


Application Related
  1. What are the extensions available for IE and Netscape?
  2. How can you develop script, to wait for complete navigation or what is the function to wait until browser is ready?
  3. What is the difference between Browser and Browser2 objects?
  4. How will you open a Browser (IE/Netscape/FireFox)?
  5. Why is a new layer of HtmlText being recorded by SilkTest 6.0?
  6. How can both Netscape and Internet Explorer declarations for SilkTest be consolidated into one set of declarations?
  7. What is the use of “SetUserOption”?
  8. What is the usage of "ShowBorderlessTables" option?
  9. What is the difference between BrowserChild and BrowserPage objects?
  10. How to specify a browser extension to a Web application?
  11. What is class map? What are the different ways of defining class map?
  12. What is option set? Have you ever used option set in silk?
  13. How will you invoke the application, which has login dialogbox?
  14. How will you invoke multiple applications in single test suite?
  15. Have you ever tested images using silk? What are the methods you have used?
  16. Custom objects - Not similar to any standard objects. For ex., Excel, SpreadSheet
  17. What is silk bean?
  18. What are the settings required to invoke a Java application?
  19. What are the settings required to identify Flex objects?


Advanced Silktest
  1. Explain about Open Agent
  2. Difference between Classic and Open Agent
  3. Explain about Silk4j.
  4. Explain about Extension Kit.
  5. Explain how silktest supports OOPs concepts? Give few examples.
  6. How will you extend a method, which is defined for a class?
  7. What does the recording statement do?
  8. How will you overwrite default script and Testcase procedures ?
  9. Have you automated any dynamic pages/controls? How have you done, explain?
  10. How silktest supports DLLs?
  11. How will you run the scripts into another machine?
  12. What are the steps or procedures, you will follow to make silktest suite as robust?
  13. Give an example of setting agent value at runtime?
  14. What is default base state in silk? How can you implement the default base state to its customized base state?
  15. When it is necessary to create a “plan” file instead of “suit” file in silk?
  16. What are the different tags available in “partner.ini” file?
  17. How can you define your own property set?
  18. Silk is having built in recovery system. How is it working?
  19. Few lines of code for some string manipulation operations.
  20. How do I set a option set file dynamically?
  21. How will you handle if a window has many parents?
  22. How will test the application remotely?
  23. Can you avoid the use of sleep()? How?
  24. Have you used Registry related functions?
  25. To create, or "spawn," multiple threads, which statements you will be going to use?
  26. Have you ever used “multitestcase”? Can you tell me in brief.
  27. What is LinkTester?
  28. What are the functions offered by DBTester?


Automation Framework
  1. What is automation framework?
  2. Tell me about few of the Industry standard automation frameworks
  3. Have you ever make an internationalization frame work using silk? What are the constraints you need to take care while making your silk framework as independent of OS, Language?
  4. Different types of framework with a brief explanation of each.
  5. Efficient ways of handling custom objects and Dynamically changing objects?
  6. Have you used XML and Excel files as your input data?

Thursday, April 30, 2009

Flex component automation with Silktest

Overview about Flex
Adobe Flex is a collection of technologies released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the proprietary Adobe Flash platform. MXML, an XML-based markup language, offers a way to build and lay out graphic user interfaces. Interactivity is achieved through the use of ActionScript, the core language of Flash Player that is based on the ECMAScript standard.

The Flex SDK comes with a set of user interface components including buttons, list boxes, trees, data grids, several text controls, and various layout containers. Charts and graphs are available as an add-on. Other features like web services, drag and drop, modal dialogs, animation effects, application states, form validation, and other interactions round out the application framework.

For more info, visit Flex Wiki page Wiki - Adobe Flex

Help from Vendors
Adobe has developed few libraries to support test automation for flex components. To know more about these libraries, you can go through following links.


Borland has given a separate document for flex configuration. You can search in Borland site for ‘QuickTour_Flex.pdf’. Similarly Adobe has published a document ‘Flex2_at_api.pdf’ for Testing Flex Components.

Even Silktest Help documentation contains few pages for Flex and Open Agent. You can check following Silktest Help pages:
  • Testing a Flex Sample Application Using a Dual Agent Approach
  • Enabling Extensions Automatically Using the Basic Workflow
  • Enabling Extensions for Embedded Browser Applications that use the Classic Agent
  • Configuring Security Settings for Your Local Flash Player


Silktest Flex API
As a first step, we need to copy Silktest flex library before building Flex components.
  1. Navigate to Windows Explorer -> Silktest_Installed_Directory\ng\AutomationSDK\Flex\3.0\Automation
  2. Copy FlexTechDomain.swc
  3. Paste into C:\Program Files\Adobe\Flex Builder 3\sdks\3.1.0\frameworks\libs
  4. In this libs folder, you can see few more files such as automation.swc, automation_agent.swc & automation_dmv.swc
Change in Flex XML configuration
To change flex-config.xml
  1. Navigate to Windows Explorer -> C:\Program Files\Adobe\Flex Builder 3\sdks\3.1.0\frameworks
  2. Open flex-config.xml and set the following:
    <include-libraries>
    <library>/libs/automation.swc</library>
    <library>/libs/automation_agent.swc</library>
    <library>/libs/FlexTechDomain.swc</library>
    <library>/libs/automation_dmv.swc</library>
    </include-libraries>NOTE: Remove the comments for include-libraries tag.

Flex Compiler Settings
  1. Open the project.
  2. Project Menu-> Properties.
  3. Select Flex Compiler.
  4. In additional compiler constants, set the following:
    -include-libraries "${flexlib}/libs/automation.swc" "${flexlib}/libs/automation_agent.swc" "${flexlib}/libs/FlexTechDomain.swc"

Browser Setting

To set security settings for Flash Player:
  1. Navigate to FlashPlayer Setting
  2. In Global Security Settings, select radio button 'Always Allow'.
  3. From the Edit Locations drop-down menu, click Add Location.
  4. Click Browse for folder and navigate to the folder where your local application is installed.
  5. Click Confirm and then close the browser.


To Enable JavaScript:
  1. In Internet Explorer 6.0 and 7.0, Choose Tools/Internet Options.
  2. Click the Security tab.
  3. Click Custom level.
  4. In the Scripting section, under Active Scripting, click Enable and click OK.

Settings in Silktest
  1. It is important to start the Open Agent before starting your flex application.
  2. Enable extensions for flex
  3. Check your include files (From Options menu-> Runtime). Flex.inc and flexDataTypes.inc files should be included in the UseFiles. I have given a sample UseFiles value of a simple project below:
    D:\Flex\MyFlex1\frame.inc,extend\explorer.inc,extend\xBrowser\xbrowser.inc,extend\Flex\Flex.inc,extend\Flex\FlexDataTypes.inc,extend\WIN32\WIN32.inc

Sunday, January 25, 2009

Mapping - Silktest Versions

Borland is using product names instead of versions for Silktest. We are using different versions of Silktest to execute our silktest suites. Sometimes it is confusing for testers, who is trying to execute silktest suites. Below I have given a mapping for product name and version.

Product Name

Version

SilkTest 20068.1
SilkTest 2006 R28.5
SilkTest 20089.0
SilkTest 2008 SP19.1
SilkTest 2008 R29.2

Saturday, January 24, 2009

New Release - SilkTest 2008 R2

Borland has released SilkTest 2008 R2 recently. It has many enhancements for Open Agent.

New Features


  1. Dynamic Object Recognition (Open Agent)

  2. Windows Presentation Foundation (WPF) Support for the SilkTest Open Agent

  3. xBrowser Support

  4. JavaScript Support

  5. Custom Class Attributes in Java SWT and xBrowser Applications

  6. Ability to Suppress Controls for Certain Classes

  7. New Methods Supported for Adobe Flex

  8. Enhancements for Silk4J Eclipse Plugin

For more information, you can have a look at SilkTest 2008 R2 documentation.

Saturday, December 13, 2008

Close the AUT after certain time

In recent days, I am trying to kill the applications if they are unable to close by the tool (SilkTest). Last month, I was solving one different issue.

We are having ten years old test suite and it was not updated for last two years due to product priorities. The total execution time for this regression suite is around 70 hours. Many times, our AUT is getting hung or the current window focus is unable to shift and suite is unable to continue after that. We endup to stop the suite at that script and re-ran the remaining scripts manually. Also we are unable to use weekends fully for the regression.

I planned to run the scripts as unattended. It is intermittent problem. Often silktest not executed in different testcases and not in one particular case always. So I thought to kill the application if the application is running more than 45 minutes. Few of silktest group members have given a idea and I have implemented it.

Silktest has 'spawn' statement to create a separate thread and it is used to execute MultiTestcase. MultiTestcae helps to run the particular code in multiple systems. Also I used PsList to get the running time of an application. I have tried few scenarios with Notepad and then finally put into our suite. This solution is worked..!!!

I have called in script level and I called 'spawn' statement in ScriptEnter and break the loop, once the execution reached ScriptExit. I have given the code below...

4Test code for ScriptEnter and ScriptExit



[+] void ScriptEnter ()
[ ] // Added for Unattended execution
[ ] gbAppKill = TRUE
[+] spawn
[ ] KillApp_UsedTime ("myAut",2700)
[ ]
[+] void ScriptExit (boolean bException)
[ ]
[ ] // Added to stop kill thread
[ ] gbAppKill = FALSE
[ ]



4Test methods to find the exeuction time and killing it


[ ] // // **** Code written for killing apps if app is running more than 45 mins.
[ ] // Methods
[ ] Boolean gbAppKill
[ ]
[+] Void KillApp_psKill (STRING sApp)
[ ] List of STRING lsOutput
[ ]
[ ] STRING sCommand = "{gcsToolsPath}\pskill {sApp} "
[ ]
[+] do
[ ]
[ ] Print ("Executing command: {sCommand}")
[ ] SYS_Execute (sCommand, lsOutput)
[ ] ResPrintList ("Command Output", lsOutput)
[ ] Print ("echo App {sApp} killed at %DATE%_%TIME% >> d:\kill.txt ")
[ ] SYS_Execute ("echo App {sApp} killed at %DATE%_%TIME% >> d:\kill.txt ")
[ ] Sleep (2)
[+] except
[ ] // Do Nothing
[ ] ExceptLog ()
[ ]
[ ]
[-] VOID KillApp_UsedTime (STRING sApp, INTEGER iKillTimeLimit optional)
[ ] List of STRING lsOutput
[ ] INTEGER iItem, iTotalValue, iTimes, iCount,iSleepTime
[ ] STRING sPartial,sItem,sPID
[ ] STRING sTime, sHour, sMin, sSec
[ ] STRING sCommand = "{gcsToolsPath}\pslist {sApp}"
[ ]
[ ] //sPID = ""
[ ]
[-] do
[ ]
[ ] iSleepTime = 50 //Seconds
[+] if (IsNull (iKillTimeLimit))
[ ] iKillTimeLimit = 6 // Seconds.
[ ]
[ ]
[ ] iCount = (iKillTimeLimit/iSleepTime) * 100 + 1+10
[ ]
[-] for iTimes=1 to iCount
[+] if (! gbAppKill)
[ ] Print ("gbAppKill is FALSE and exiting from Spawn thread..")
[ ] break
[ ]
[ ]
[ ] Sleep (iSleepTime)
[ ]
[ ]
[ ] Print ("Executing command: {sCommand}")
[ ] SYS_Execute (sCommand, lsOutput)
[ ] ResPrintList ("Command Output", lsOutput)
[ ]
[+] for iItem=2 to ListCount (lsOutput)
[ ] sItem = lsOutput[iItem]
[+] if (MatchStr ("{sApp}*",sItem))
[ ]
[ ] sSec = GetField (sItem,":",5)
[ ]
[+] if (IsNull(sSec) || (Trim(sSec) == ""))
[ ] continue
[+] else
[ ] sTime = GetField (sItem,":",3)
[ ] sMin = GetField (sItem,":",4)
[ ] sHour = SubStr (sTime,Len(sTime)-3)
[ ]
[ ] Print ("Hour: {sHour}")
[ ] Print ("Minutes: {sMin}")
[ ] Print ("Seconds: {sSec}")
[ ] iTotalValue = Val (sMin) * 60 + Val(sHour) * 3600
[ ] Print ("App {sApp} - running total time: {iTotalValue} Seconds")
[ ]
[+] if (iKillTimeLimit <= iTotalValue)
[ ] Print ("Application {sApp} is running {iTotalValue} seconds -beyond expected time {iKillTimeLimit} seconds.")
[ ] KillApp_psKill (sApp)
[ ] Print ("Going to kill Application {sApp}")
[ ] // break // It is suitable for testcase level
[+] else
[ ] Print ("Application {sApp} is running {iTotalValue} seconds - not exceeding expected time {iKillTimeLimit} seconds.")
[ ] // return sPID
[ ]
[ ]
[ ]
[+] except
[ ] // Do Nothing
[ ]
[ ]
[ ]

Monday, December 8, 2008

Closing Excel instance by VBScript

We have a test suite for Excel plug-in. Silktest built-in function does not work for Excel 2007. It is working fine for Excel 2003. Silktest is unable to close the Excel 2007 instance. We used Taskkill to kill the excel. It has created few other issues. I was looking for alternative solution. So I decided to write a vb script and got success. I have given the code below.

VBS code - To close Excel


'-------------------------------------------------------------------------
' File : CloseExcel.vbs
' Author : Palani
' Purpose : To close the excel, if it is already opened.
'
'' Revision History:
''$Log: CloseExcel.vbs,v $
''
'-------------------------------------------------------------------------
'' Usage
'' cscript D:\rpm_scripts_palani\tools\CloseExcel.vbs
'' cscript CloseExcel.vbs


'******** Variables Declaration
Dim gsLogFile

'******** Function calls
call CloseExcelApps ()


'--------------------------------------
' Method : CloseExcelApps
' Author : T. Palani Selvam
' Purpose : Close Excel application.
' Parameters: - Nil
' Returns : - Nil
' Caller : - Nil
' Calls : - Nil
'--------------------------------------
Sub CloseExcelApps()
Dim sExcelPath 'As Variant 'Excel file
'********** Excel object declaration **********'
' Excel Application object
Dim objExcel 'As Excel.Application
Dim objExcel2 'As Excel.Workbooks
Dim objXLWorkbook 'As Excel.Workbook


On Error Resume Next

Set objExcel = GetObject(,"Excel.Application")
If Not (IsNull(objExcel) Or IsEmpty(objExcel)) Then
WScript.Echo ("Excel application instance Exists..")
'Set objXLWorkbook = objExcel.ActiveWorkbook

'You can set this property to True if you want to close a modified workbook
'without either saving it or being prompted to save it.

objExcel.ActiveWorkbook.Saved = True
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit

'objExcel.Worksbooks.Close
'objExcel.Quit

Set objExcel = Nothing
Set objExcel2 = GetObject(,"Excel.Application")
If Not (IsNull(objExcel2) Or IsEmpty(objExcel2)) Then
Set objExcel2 = Nothing
WScript.Echo ("FAIL. Excel application is not closed properly.")
Else
WScript.Echo ("PASS. Successfully closed Excel application.")
End If
WScript.Echo ("End - Closing excel application instance.")
else
WScript.Echo ("Excel application instance does not exist!....")
End If
End Sub

Sunday, November 2, 2008

Windows XP - System failure

Last month, My home PC did not boot at all. I searched the solutions on Internet and tried many things. Even Microsoft's knowledge base articles were not solved my problem.

Problem 1: winlogon.exe - Application Error
Initially I got the WinLogon.exe error dialog box and then it was restarted automatically again and again. The dialog box message was like below:
-----------------------------------------
winlogon.exe - Application Error
------------------------------------------
The instructions at "0x759723ee" referenced memory
at "0x00000000". The memory could not be "read".

Click on OK to terminate the program
Click on CANCEL to debug the program
-------------------------------------------

System was restarted, if I click OK butto or Cancel Button. Then I restarted the system by all startup modes. I have explained all these modes in my previous post - Strange behavior with Service Pack . None of the modes helped me. I got blue screen, while I was trying by startup mode - Disable Automatic restart on system failure. I searched on net and applied many solutions. None of them worked out...

Solution 1
From softwaretipsandtricks.com

  1. Boot with winxp cd
  2. Log in to recovery console
  3. chkdsk /r


Solution 2
This is a problem with virtual RAM, I've had it before with various steam games, try lowering the size of the paging file (I'm pretty sure you can do that from the recovery console) or deleting it completely just so you can log on, then set the paging file back up again, with a lower size. This problem also arises if you have page files on more than one hard disk, its better to have 1 3GB page than 2 1.5GB ones on separate hard disks.

Solution 3
It's simple, just download hijack.exe and killbox.exe. Run Hijack. Look for these types of process in the hijack log:
O20 - Winlogon Notify: arergiti - arergiti.dll
O20 - Winlogon Notify: bdicjulx - bdicjulx.dll (this is only an example, it will not be the same dll files in your case, just put the types of these trojans for your understanding) kill all these dll files comes under the heading "Winlogon notify" using killbox (use the option 'delete on reboot')..and it is simple as that...nothing to worry..Just check for Winlogon nofify errors and delete all these dlls which fall under this category (i.e. "winlogon notify")

Solution 4
mbrando.com
We’ve had 15-20 machines suddenly start doing this in the last month. I’ve narrowed it down to an issue with the RPC and DCOM services; by default they are both set to “Restart the computer” if they can’t start.
We’re still working with Microsoft to determine why this suddenly started, but we have at least figured out that after several reboots and if you let it sit at the logon screen for a while before attempting to logon, you can sometimes get it to boot all the way into Explorer. If you get that lucky, go into your services and set the recovery options for both services to “Restart the service” instead of “Restart the computer”.

Solution 5
I had the same issue and I was able to hit CTRL+ALT+DEL before the error message popped up and then login and do a system restore. Not sure if that will work for anybody else, but just thought I’d throw this out there (problem happened after the Monday update from MS Update).

Solution 6
I was getting the same error message. But used the click here underlined for details. Stated the problem was with the uxtheme.dll file. So from msconfig, I uncheck the theme services. Rebooted with no errors. Realized that it turned off my XP Theme. So went into Services from Admin Tools, and set disable to automatic and click the Start button, to start the service. Then rebooted. Have not received the error since.

UXTheme is the XP Theme package, but was recently updated in a patch. So maybe chalk it up as a bad install. Now repaired.

Another option is to go to c:\windows\system32 and find the uxtheme.dll file. Rename it to uxtheme.dll.old. Then restart. Should repair, reinstall itself.

Problem 2: Stop 0x000000B4 The Video Driver Failed to Initialize
After doing Chkdsk command, I was getting the blue screen. After this stage, I didn't get Winlogon.exe - Application Error. I did Google search for this system error and I got few solutions for that.

Solution 7
From forums.techguy.org
It may be the built in VGA driver is corrupt. You could try replacing it in Recovery Console from the CD. I've attached a screen shot of the commands.

To do this boot into the Recovery Console. This should leave you at a C:\Windows prompt. Enter the following commands:

cd system32
ren vga.dll vga.dllold
ren vga.drv vga.drvold
cd drivers
ren vga.sys vga.sysold
expand d:\i386\vga.sy_
cd ..
expand d:\i386\vga.dl_
expand d:\i386\vga.dr_


Exit, and then try Safe Mode and/or Enable VGA Mode.

Solution 8
From forums.cnet.com
To anyone with this same problem - here's how I recovered my files:

Changed my Bios to boot from Windows XP DVD-ROM.
Installed XP to the SAME PARTITION as my corrupt one, only I created a new folder entitled XP_2.
It did get stuck once on the "34-min left" but I just re-tried and it worked the second time.
When it was done installing, it asked me for an account name - DO NOT NAME THE PROFILE ACCOUNT THE SAME AS ANY OF YOUR ALREADY EXISTING ACCOUNTS. I made a generic account name.
When it was done installing, go into your hard drive, documents and settings and voila! There you will see your other user accounts along with their desktops and my document folders. Also, you will be able to see your Program Files and any other hard drive folders you need.

Solution 9
One other thing Microsoft help says may cause the B4 STOP is a port conflict. If your laptop has a parallel port, disable in BIOS or change I/O address to 0378 from 03BC.

Solution 10 - From Microsoft Knowledge base
Solution - STOP: 0x000000B4 The video driver failed to initialize.
Solution - STOP: 0x000000B4 The video driver failed to initialize
SYMPTOMS
When you try to start Windows 2000, you may receive the following error message (on a blue screen):
*** STOP: 0x000000B4
The video driver failed to initialize.

Additionally, you cannot start Windows in Safe mode.

Solution 11 - Virus Infection
None of these solutions were worked for me. microsoft.public.windowsxp.customize. I got a idea from this post. I did following steps.

  • Removed the hard-disk from my PC.

  • Have connected the my PC through external drive to my Laptop. Both systems are having Windows XP SP2

  • Ran the anti-virus program for G drive, which is C Drive for my home PC.

  • 2 DLLs (under C:\Windows\System32) got infected. Removed those files.

  • Deleted 2 files under C:\Windows\System32, which are created on that day (based on the time-stamp).

  • Connected the hard-disk to my home PC again. Started my PC through WinXP setup CD.

  • Automatically Upgrade workstation was executed from Windows CD (Repair Windows Installation).

  • Rebooted System successfully and did not get any system errors..

Sunday, September 28, 2008

Children objects has negative co-ordinates in Browserchild

Last year, one web based product has been revamped with our own reporting modules. Lot of javascripts used for this reporting. Silktest is able to identify the HtmlTable and HtmlColumn objects properly. But the co-ordinates are shown wrong. Each click action is done in different point instead of expected point. Only X-Axis position got changed. See the RECT info below.

BrowserChild (Parent) rect: {195, 175, 827, 538}
Htmltable rect: {-77, 323, 818, 574}


It is varying for different kind of reports. Testcases need to do left-mouse click and right-mouse clicks. I have set few variables for position changes. I have written the code like below. In the Runtime, XAxis changes (ixGridInc) are calculated dynamically. I have given the code below:

4Test code - To set the Table position dynamically


[-] void SetGridTablePosChanges (Window wTable)
[ ] // To set xAxis and YAxis increments (changes)
[ ] // Position changes.
[ ] Window wParent
[ ] Boolean bxGetPos = FALSE
[ ] String sWinTag, sMainFrameTag
[ ]
[ ] RECT rtTblCell = wTable.GetRect (TRUE)
[ ] Print ("table rect: {rtTblCell}")
[ ]
[-] if (ixGridInc == -1)
[ ] Print ("Grid xAxis increment is going to set.")
[ ] ixGridPos = rtTblCell.xPos
[ ] // iyGridPos = rtTblCell.yPos
[ ] bxGetPos = TRUE
[-] else if (ixGridPos != rtTblCell.xPos)
[ ] bxGetPos = TRUE
[ ] ixGridPos = rtTblCell.xPos
[ ] // iyGridPos = rtTblCell.yPos
[-] else
[ ] Print ("Already Grid xAxis increment is available.")
[ ]
[-] if (bxGetPos)
[ ]
[ ] sMainFrameTag = WindowTag (wTable)
[ ] sWinTag = GetField (sMainFrameTag,"[BrowserChild]",3)
[ ] Print ("Whole Table tag: {sMainFrameTag}")
[ ] Print ("Parent tag: {sWinTag}")
[-] if (MatchStr ("*[6]*",sWinTag) || MatchStr ("*mainFram*",sWinTag))
[ ] wParent = MyReportPage
[ ] RECT rtTblCell2 = wParent.GetRect (TRUE)
[ ] Print ("Parent rect: {rtTblCell2}")
[ ]
[-] if ((rtTblCell.xPos < (rtTblCell2.xPos + XAXIS_TABLE_DIFF)) )
[ ] ixGridInc = rtTblCell2.xPos - (rtTblCell.xPos) + XAXIS_TABLE_DIFF
[ ] Print ("X Axis changed Position: {ixGridInc}")
[-] else
[ ] Print ("Parent{wParent} is not expected one.")