RelevantCodes[1]One – QTP Automation Framework

The first release of RelevantCodes[1]One – QTP Automation Framework is ready, and has been successfully tested on QTP versions 9.2, 9.5 and 10.0. I would like to thank Clive Farrington, Mahesh Upadhyay and Sunitha Reddy for helping me beta-test this framework. I really appreciate your efforts, guys!

Download RelevantCodes[1]One (13268)

Be sure to view the videos at the end of this post, which show RelevantCodes[1]One being initiated through the Excel Table, and full executions on versions 9.2 and 10.0.

January 27, 2010: Added examples. These show how DP statements can be converted to RelevantCodes[1]One keywords.

Features:

  • OO Architecture
  • Custom DOTNetFactory Form
  • Hierarchical Reporting
  • Product Version Settings
  • Single Block for Loading and Unloading Global Objects
  • Advanced Dictionary Object usage
  • Generic Structure (Currently supports Web & Standard Windows)
  • Simple Validations
  • Custom CheckPoints
  • Supports execution on multiple windows/browsers (see Test Case 002)
  • Simple Reporting
  • Data Sheet with Custom Macros (macros will not available for viewing)
  • Customized Test Execution
  • Supports multiple object descriptions

I have tried to keep everything quite basic in this release, but there will be several enhancements in the next, including a CustomUserActions object which will give ability to create tests from the Table as well as perform custom actions through code simultaneously. Also in the next release will be featured an upgrade to the Implementor Class, that will enable multiple iterations of a group of statements from the Data Table.

Setting Up

1. Download, unzip and copy the RelevantCodes folder to your “C:\”. The folder structure should look exactly like:

C:\RelevantCodes\RelevantCodes[1]One\0.1

2. In the folder C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources\Excel Tables: change the name of the relevant table to Data.xls. If you are using QTP 9.2 or below, rename Data92.xls to Data.xls. For versions 9.5 and higher, rename Data95+.xls to Data.xls.

Current Version

0.1 Beta

Found a Bug. What should I do now?

If any issues that you may encounter, please use the comments section to notify me. I will try to have the fix ready, and the fix will be implemented in the next version, giving full credit to you for finding the bug. If the bug requires a small fix, then, the solution will be available for everyone to view/download immediately.

Will it support other technologies other than Web and Standard Windows?

Technically, this design is capable of working with all sorts of technologies, but because I don’t have access to other add-ins, this may not be possible in the near future. However, if someone is willing to utilize their time in this upgrade, you are most welcome to. If you get this framework to work with other technologies successfully, I would be happy to share it with the everyone giving full credit to your extraordinary work.

Does RelevantCodes[1]One come under any warranties?

No, and Relevant Codes, Anshoo Arora or any associated parties cannot be held responsible for any damage caused by the use of RelevantCodes[1]One.

Copyright Notice / License Agreement

RelevantCodes[1]One is being released under Creative Commons 3.0 Attribution License. For more information about this license, please view this topic at Creative Commons website. In other words, you can distribute, remix, tweak, and build upon this framework as long as you give proper credit to the authors, and to RelevantCodes.com. You must also leave the terms in the License Agreement in the source folder unchanged. Click here to view the Creative Commons 3.0 Attribution license legal code.

Creative Commons License
RelevantCodes[1]One Automation Framework by Anshoo Arora [RelevantCodes.com] is licensed under a Creative Commons Attribution 3.0 United States License.
Based on a work at relevantcodes.com.

Defects

1. Implementor.cls.vbs => Function CheckProperty: The value parsed after using Mid(), the property value stored in sExpected the result is stored in a variable cast as string, however, when using Execute() to set the value of sValue the value is being stored in a variable cast as boolean when performing the compare on these two variable types the checkpoint is failing when it should be passing. [Snapshot] [Credits go to Brock Vietor for reporting this defect; this defect is reported as-is from Brock's e-mail. Brock: Many thanks for your great reporting style and wonderful feedback!]

2. Engine.vbs.cls: Remove/Comment line #15 (Private TestData). Instead, insert Public TestData on line 2. This should fix the bug as reported in this comment. [Credits go to Daim Phillips for finding and reporting this defect. Daim: Thanks for all your time and efforts that went into finding and reporting this defect!]

Converting DP Into RelevantCodes[1]One Keywords

Example 1: Click Image

Browser("title:=Test").Page("title:=Test").Image("name:=ThisImage").Click
Parent       | Child | Description     | Event | Value
--------------------------------------------------------------------------
Browser Page | Image | name:=ThisImage | Click | ""

Example 2: Click Image (Multiple Properties)

Browser("title:=Test").Page("title:=Test").Image("name:=ThisImage", "index:=0").Click
Parent       | Child | Description                 | Event | Value
--------------------------------------------------------------------------
Browser Page | Image | [name:=ThisImage][index:=0] | Click | 

Example 3: Enter Value in a Text Box

Browser("title:=Test").Page("title:=Test").WebEdit("name:=ThisText").Set "RelevantCodes[1]One"
Parent       | Child   | Description    | Event | Value
--------------------------------------------------------------------------
Browser Page | WebEdit | name:=ThisText | Set   | RelevantCodes[1]One

Example 4: Launching a Browser and Clicking “Links”

SystemUtil.Run "iexplore.exe", "http://relevantcodes.com"
Browser("title:=.*Relevant Codes.*").Link("innertext:=Links").Click
Parent       | Child | Description      | Event  | Value
--------------------------------------------------------------------------
Browser      |       | Relevant Codes   | Launch | http://relevantcodes.com
Browser      | Link  | innertext:=Links | Click  | 

Example 5: Launching a Browser, Clicking “Links” and closing the Browser

SystemUtil.Run "iexplore.exe", "http://relevantcodes.com"
Browser("title:=.*Relevant Codes.*").Link("innertext:=Links").Click
Browser("title:=.*Relevant Codes.*").Close
Parent       | Child | Description      | Event  | Value
--------------------------------------------------------------------------
Browser      |       | Relevant Codes   | Launch | http://relevantcodes.com
Browser      | Link  | innertext:=Links | Click  | 
Browser      |       | Relevant Codes   | Close  |

Example 6: Launching a Browser, Clicking “Links”, Synchronizing and closing the Browser

SystemUtil.Run "iexplore.exe", "http://relevantcodes.com"
Browser("title:=.*Relevant Codes.*").Link("innertext:=Links").Click
Browser("title:=.*Relevant Codes.*").Sync
Browser("title:=.*Relevant Codes.*").Close
Parent       | Child | Description      | Event  | Value
--------------------------------------------------------------------------
Browser      |       | Relevant Codes   | Launch | http://relevantcodes.com
Browser      | Link  | innertext:=Links | Click  |
Browser      |       | Relevant Codes   | Sync   |
Browser      |       | Relevant Codes   | Close  |

Example 7: Adding a new Browser to the Object Class

Note: The Activate method can be used to Activate a Browser, as well as add it to the clsImplementor Object Collection. This example shows how a resulting (new) browser TestDomain2 is added to the collection by specifying its properties.

'Open New Browser
SystemUtil.Run "iexplore.exe", "http://Domain.com"
'Clicking the link opens another Browser
Browser("title:=testDomain_1").Link("innertext:=OpenNewBrowser").Click
'Synchronize with new browser
Browser("title:=testDomain_2").Sync
Browser("title:=testDomain_2").Close
Browser("title:=testDomain_1").Close
Parent       | Child | Description      | Event  | Value
--------------------------------------------------------------------------
Browser      |       | TestDomain1               | Launch   | http://Domain.com
Browser      | Link  | innertext:=OpenNewBrowser | Click    |
Browser      |       | TestDomain2               | Activate | title:=testDomain_2
Browser      |       | TestDomain2               | Sync     |
Browser      |       | TestDomain2               | Close    |
Browser      |       | TestDomain1               | Activate |
Browser      |       | TestDomain1               | Close    |

Demos

I have created 3 simple runs. The first demonstrates RelevantCodes[1]One usage with a single browser, the second run demonstrates its usage with multiple browsers simultaneously and the last one demonstrates a simple execution with a standard windows application. The 4th test case is blank, and you can create more such blank test cases to experiment with this framework. The “Execute Y” determines which test case in the Excel Spreadsheet are going to be executed. Any test case with “Execute N” flag will not execute.

Executing Selected Tests through Excel Spreadsheet

Version 9.2

Version 10.0

Download RelevantCodes[1]One (13268)

RelevantCodes[1]One Automation Framework

Subscribe for Relevant Codes newsletter to get awesome updates and articles delivered straight to your inbox.

Comments on this entry are closed.

  • John Dillard June 22, 2010, 6:38 am

    I have password cracked the macros since there’s no logical reason to not share this kind of code. I can post this information if anyone is interested. Shame on the original author for not doing so. We should be sharing ALL code, not hiding it.

    • Anshoo Arora June 22, 2010, 8:18 am

      John,

      Thanks for your feedback.

      Really, its a matter of shame that I chose not to share ‘only a bit of code’ from the framework that I utilize at my clients’ environments. Moreover, I requested people not to crack it mainly because its a matter of privacy and a small favor to protect original code that is written by me.

      I feel hurt to receive this feedback when this website runs at absolutely no cost to its users. There is absolutely no advertising bringing in revenue. There is no registration process. Everything is open – anyone from anywhere can read the content here as many number of times as they want – for FREE.

      Its good to listen to criticism because I see it as an opportunity to improve on what I am doing and its always good to hear from people how they can do something better. But, I don’t see this comment as constructive criticism. It was a mere request to allow me to not share this code – sure you can crack it, but it clearly shows that its always easier to take the wrong means to finding a solution than writing one yourself.

      I am closing comments on this thread. However, the framework will still be available for download.

  • Venkat June 17, 2010, 8:39 am

    Hi Anshoo,

    Your framework is excellent. I am trying to implement into my project. I have a question.

    In my web application I have to enter a mobile number and click continue.
    If this mobile number has multiple enrollments then the user will be presented with a screen to select an enrollment. On the other hand if it has only 1 enrollment then the user will not be presented with this screen.
    After the enrollment process is over, it will check for market. If it has multiple markets associated with this mobile number then the user will be presented with a screen to select a market. On the other hand if this mobile number is associated with only 1 market, then user will not be presented with this screen

    My question is how to handle this with your Frame work?

    I would really appreciate if you can resolve this issue.

    Thanks,
    Venkat

    • Anshoo Arora June 22, 2010, 12:33 pm

      Hi Venkat,

      I think your question is excellent and it uncovers an IMMENSE limitation with this framework. As this was launched as a demo project, I didn’t include some of the concepts that I would in a customer centric implementation. I did plan to include most of these features in its next version but because of prior obligations and a few recent projects, I haven’t been able to do a lot of development. Hopefully in the near future though :)

  • Jayachandra June 10, 2010, 7:18 am

    Hi Anshoo,

    Thanxs alot for the frame work ..

  • Suresh June 5, 2010, 6:52 pm

    Hi Anshoo,

    I liked this framework so much, You have done a great job. Hey i have a question regarding using of multiple rows of data (Data driven). Is this framework can be used to run like a data driven testing. Also I am wondering how to use the check points (what type of check points) using this and how to use recovery scenarios in this, also normally we use GetROProperty to capture the values in data driven testing to use those values in the testing, Can we handle like those scenarios here.

    Many thanks

    Suresh

  • Joseph June 4, 2010, 12:29 am

    Hi Anshoo,

    I am trying to implement Java Add in this framework. Could you give me the details of what files need to be changed.

    With best regards

  • Joseph June 3, 2010, 9:38 pm

    Hi Anshoo,

    I am trying to run this but it got stuck at Execution Selector, After clicking on Execute Selected button in Demo.xls it open QTP 9.2 then it was stuck. After i manually clicked on Execute Engine it opened browser http://newtours.demoaut.com/ but did not enter any values after some time it opened google.com web page and did not do anything. My QTP 9.2 is located in D Drive not C Drive.

    I changed Engine script path to D Drive but it still did not work.
    dicMetaDescription(“DllPAth”) = “D:\Program Files\Mercury Interactive\QuickTest Professional\bin\ContextManager.dll”

    After stopping the test i checked the functional libraries were attached, but test could’nt run. I am using Excel 2003.

    Could you please let me know what should i do to make the test run.

    Many thanks

    Anshoo

    • Joseph June 3, 2010, 10:01 pm

      Hi Anshoo,

      After selecting all the add ins it worked perfectly.

      Thanks

  • prasad June 3, 2010, 5:30 am

    Hi Anshoo,
    I am getting the general run error when the script running. Please advise me in the same.

    The error is ‘The parameter is incorrect’

    Thanks,
    Prasad

    • Anshoo Arora June 7, 2010, 8:49 am

      On which line are you getting that error Prasad, and from what keywords?

  • Mallikarjuna June 2, 2010, 5:55 am

    Hi Anshoo,

    I have few questions for u

    1. If two browsers are open, how do I close only one broweser?
    2. What spllit function does?

    Thanks in Advance

    • Anshoo Arora June 7, 2010, 8:46 am

      1. There are several ways of doing this. You can use CreationTime, Index, Location, Title, Name etc. It depends on the requirement..
      2. See here.

  • Bhavi May 27, 2010, 7:05 am

    Hey Anshooo,

    Gm!

    While running my script i am getting following error: This key is already associated with an element of this collection but i was not able to produce the same error before? please do suggest how to resolve this issue?

    Thanks,
    Bhavya.

    • Anshoo Arora June 1, 2010, 5:34 am

      This can be caused if the same key is being used the 2nd time for the same dictionary object. Is this related to the framework? Can I see the excel sheet?

  • Rajesh May 27, 2010, 1:13 am

    Hi Ansoo
    While Executing the script i am facing issues like its Seting HWND value in Edit box instead the value passed in excel ?
    Why isit happening .
    Does it works on Ext-Js Pages?

    • Anshoo Arora June 1, 2010, 5:32 am

      Rajesh,

      Not sure what you mean? Is this about the framework discussed in this post?

  • RoGer May 20, 2010, 9:31 pm

    Hi Anshoo,
    I got a problem when running your demo,after the QTP appears,it finished running immediately and the result shows that:
    Run Error Variable is undefined: ‘Engine’ Line (16): “Engine.Run”. Failed 2010-5-21 – 9:53:48

    My QTP version is 9.5 and installed in E:\Program Files\HP\QuickTest Professional\

    • Anshoo Arora May 26, 2010, 8:52 am

      That’s quite strange. Run is a method, not a variable so not sure why QTP is throwing that error. But there are 2 defects reported by the community and have been included in the post:

      1. Implementor.cls.vbs => Function CheckProperty: The value parsed after using Mid(), the property value stored in sExpected the result is stored in a variable cast as string, however, when using Execute() to set the value of sValue the value is being stored in a variable cast as boolean when performing the compare on these two variable types the checkpoint is failing when it should be passing. [Snapshot] [Credits go to Brock Vietor for reporting this defect; this defect is reported as-is from Brock's e-mail. Brock: Many thanks for your great reporting style and wonderful feedback!]

      2. Engine.vbs.cls: Remove/Comment line #15 (Private TestData). Instead, insert Public TestData on line 2. This should fix the bug as reported in this comment. [Credits go to Daim Phillips for finding and reporting this defect. Daim: Thanks for all your time and efforts that went into finding and reporting this defect!]

      You may want to look at #2 and maybe that will fix it?

    • Anonymous May 26, 2010, 9:42 pm

      I had fixed the bug in Engine.vbs before running the demo and moved the code “PUBLIC Engine : Set Engine = New clsEngine” to the end of the Class definition ,the problem still occurs.

    • Anshoo Arora June 1, 2010, 5:31 am

      Its hard to determine what may be causing this problem. Can you open the test manually and see if the library is associated with it? It seems as if the library is not being found thus the ‘Run Error Variable is undefined’ error.

    • RoGer June 3, 2010, 10:46 pm

      I opened the test manually and the libraries were attached

  • Dhirendra May 12, 2010, 1:13 am

    Hi Anshoo,
    Am getting the problem while executing the testcase from excel ,it’s showing that “MIcrosoft office excel is waiting for another application to complete an OLE action.”
    Please suggest me the needful.

    Thanks,
    Dhirendra

    • Vishal May 12, 2010, 2:24 am

      Hi Dhirendra,

      I think there is some problem to open IE6 so U have to install the IE6.

      Thanks
      Vishal

    • Anshoo Arora May 12, 2010, 10:25 am

      Dhirendra,

      Please see here.

  • Radhika May 4, 2010, 11:24 pm

    Hi Anshoo,

    Great job. You have explained framework in very simple manner. Can you also give idea what frameworks are and why we use them, in what scenarios it is applicable, etc. How to create one from scratch like the one you have above. I want to learn and build frameworks like how you do…. :)

    Kindly help.

    Regards,
    Radhika

    • Anshoo Arora May 12, 2010, 10:29 am

      Hi Radhika,

      This is a very broad topic but I would like to recommend you to start here – an excellent read on test automation frameworks.

  • sireesha April 27, 2010, 4:09 pm

    Hi Anshoo,

    Great job and thanks for providing us with the new framework.

    I have been trying the same way as per the demo and i replaced my keywords in testcase001. below is the format, i was able to lunch the application but failing at step 2, please let me know if anything going wrong from below and help me to proceed.

    Browser Managemnt Launch https://one.com/home
    Browser Page WebEdit [name:=j_username][html tag:=INPUT] Set test1234
    Browser Page WebEdit [name:=j_password][html tag:=INPUT] Set test1234
    Browser Page Link [name:=Login][html tag:=A] Click
    Browser Page Main Dashboard Sync

    Thanks,
    Sireesha

    • Anshoo Arora April 28, 2010, 2:52 am

      Sireesha,

      What is the failed message? The code looks fine. Can you e-mail me the Data sheet at anshoo [dot] arora [at] relevantcodes [dot] com?

    • Vishal Singh April 28, 2010, 3:37 pm

      Hi Sir.

      Please can you me your Framework i think it will be very use full for me also i want to know how to develop the framework in QTP with the help of excel. you are doing Great Job. I hope you will send me your Framework.

      My email id is vishal04061986@gmail.com

      Thanks & Regards
      Vishal Singh

    • Anshoo Arora April 29, 2010, 3:11 pm

      The download link is at the topmost of this post. You can use this link as well.

    • Vishal Singh April 29, 2010, 3:34 pm

      Thanks you sir.

      But the Data.xls File is protected by password . sir i want to see all the micros you have written. how you are executing the QTP through Excel file that is very challenging work you have done. plz can you tell me the password.

      Thanks & Regards
      Vishal Singh

    • Vishal Singh April 28, 2010, 3:40 pm

      Hi Sir.

      Please can you send me your QTP Framework i think it will be very use full for me also i want to know how to develop the framework in QTP with the help of excel. you are doing Great Job. I hope you will send me your Framework.

      My email id is vishal04061986@gmail.com

      Thanks & Regards
      Vishal Singh

  • prasad April 27, 2010, 3:34 am

    Hi Ashoo,

    Really thanks for the great information with your site.

    I developed the script for IE6 browser and now i want to run the same script with different browsers like IE7,IE8 and Firefox.Is it possible if so please guide me to do this…..

    Thanks inadvance for your help…..

    Thanks,
    Prasad

    • Anshoo Arora April 28, 2010, 2:50 am

      Hi Prasad,

      Its surely possible. What version of QTP are you using and what methodology did you follow in creating your scripts (DP or OR)?

    • Anonymous April 28, 2010, 5:24 am

      Hi Anshoo,

      Thanks for your quick resonce.

      I am using QTP 10.0 and OR concept.Please resolve the issue for me and it will be great help for me.

      Thanks,
      Prasad

    • Anshoo Arora April 28, 2010, 1:46 pm

      I think besides Firefox, everything should work quite well. Something to take note of is that, with different IE versions, the Dialog type are different. With Firefox, you may not even see the same certificate error which you would with IE. Also, I have noticed that with Firefox, playback is possible with OR so what you’re trying to do can be accomplished with QTP 10, but you will have to create several workarounds to ensure your scripts work well for each browser.

      Have you tried executing your scripts across these browsers yet? Any issues so far?

  • pankaj April 19, 2010, 5:30 am

    Hello Anshoo,

    First of all, Thankx a tonne for this Valuable contribution to the testing community.

    I am working on an application where the keyword Browserpage cant be used. The reason for this is that the values of Browser and Page are different. As Such QTP has issues in Recognition.

    The sample Script is as follows:

    Browser(“QA: 4.3.2 Site”).Page(“Pankaj”).Link(“Weekly View”).Click

    Kindly Suggest what can be done in this case.

    TIA

    • Anshoo Arora April 28, 2010, 2:50 am

      Hi Pankaj,

      What kind of recognition issues do you encounter? Are the objects being viewed as WinObjects?

    • Pankaj April 28, 2010, 2:57 am

      Hello Anshoo,
      Thnx for the reply. These are web objects and while i separately record from QTP I am getting different values for browser and page and it gets recognized. With framework, i am unable to use browserpage. So i tried with other keywords also but to no avail. The object is not at all recognized.

      Browser(“QA: 4.3.2 Site”).Page(“Pankaj”).Link(“Weekly View”).Click

      Please notice that browser and page have different values. Here iam trying to click on a menu which is embedded in an asp page

    • Anshoo Arora April 28, 2010, 1:44 pm

      You will have to retrieve the properties of the Link through the Object Spy. The way this framework has been written, once you launch the framework, you will never have to worry about its changing properties. The framework will sort everything out for you.

  • Narasimha April 16, 2010, 4:48 am

    Hi Anshoo,

    This is Narasimha, working for QTP for a small time period, right now we are developing one frame work. I have a doubt regarding framework structure. I am descripting my frame work flow at below:

    First frame work calls main sheet which contains modules and header (which tells yes or no for particular module to execute)
    Then it calls testcaseflow function which access the testcase data sheet(contains tescase id, steps, keyword, input, etc.)
    After this it calls keyword and based on that total flow works and executes successfully.

    Here I have one difficulty is under input, if I use data for single user it works fine, for multi users, how to handle?
    I have tried by giving variable under input parameter and accessing another sheet but here horizontal rows vs vertical columns in the other sheet which gives difficulty to understand

    I thout about using action based script, upto now I have used vb script, shall i use action based script mixed with vb script based framework.

    Can u tell me what type(action based or vb script based) in framework development generally?

    Please suggest me regarding this

    • Anshoo Arora April 28, 2010, 2:49 am

      Here I have one difficulty is under input, if I use data for single user it works fine, for multi users, how to handle?

      What issues did you encounter with multiple users?

      I thout about using action based script, upto now I have used vb script, shall i use action based script mixed with vb script based framework.

      I don’t think you will be able to achieve the same level of performance if you were to create most of the components through function libraries. Actions are quite slow, which is why you see most frameworks using a single action-tests with just one (or a few keywords) to initiate the framework execution.

      Can u tell me what type(action based or vb script based) in framework development generally?

      I have mostly developed frameworks that are run solely from function libraries. Have little experience developing Action based frameworks, and wouldn’t like to do it either ;P mainly because of performance overhead. As most of the code is in function libraries, there is little scope for the same code to be kept in Actions anyways..

  • Vishal Singh April 11, 2010, 3:12 am

    Hi Sir,
    Please can u send me a Framework QTP framework which u have develop in Excel i see your articles in this website i am so happy u r doing grate job. i want refar your framework to understand how the QTP framework works.
    My Email Id is vishal4686@gmail.com
    Thanks & Regards
    Vishal Singh

    • Anshoo Arora April 12, 2010, 12:15 am

      Vishal,

      The framework in this post is available for download and runs on Excel. I tried the download link and it seems to be working.. Are you having trouble downloading it? If yes, I can upload it to another mirror.

  • Gaurav April 10, 2010, 2:14 pm

    Hi Anshu,

    While i am selecting “Execute Selected” command button on Excel File error “Quick test Pro Must be install to run this demo”
    i already have QTP 9.2 installed on my machine.

    Pls provide the solution.

    Thanks
    Gaurav

    • Anshoo Arora April 12, 2010, 12:18 am

      Gaurav,

      Are you able to start QTP from a VBScript file? I think if its not starting through Excel, it may not start through the .vbs file either – and you might need to run the QTP batch file to re-register all tool components/DLLs.

  • Bharath April 9, 2010, 7:51 am

    Hello Anshoo,
    I hope you remember me.
    Please review and provide comments based on your availability.

    http://bharath-marrivada.blogspot.com/2010/02/qtp-dual-function-hybrid-automation.html

    Regards,
    Bharath,

    • Anshoo Arora April 12, 2010, 12:07 am

      Will do, Bharath. Thanks for visiting Relevant Codes :)

  • Murali April 8, 2010, 4:24 am

    Hi Anshu,

    I have gone through the framework. Its really cool. I have couple of questions.
    while executing the scripts I encountered one pop up message saying “Microsoft Office Excel is waiting for another application to complete an OLE action.”

    And also I have a question here. Two columns mentioned as BrowserPage and Child. But If I have hierarchy like below how can I handle that.
    Eg:- browser().page().Frame().webedit ().set

    One more thing I dont understand how does the Description has been given. Do I need to give by spying the application through QTP?

    But altogether that is an excellent effort and really a new way to the people who are looking to create a new frameworks.

    Regards
    Murali Kunda

    • Anshoo Arora April 12, 2010, 12:04 am

      Murali,

      And also I have a question here. Two columns mentioned as BrowserPage and Child. But If I have hierarchy like below how can I handle that.
      Eg:- browser().page().Frame().webedit ().set

      The framework will auto-create the entire hierarchy once you specify the browser description.

      One more thing I dont understand how does the Description has been given. Do I need to give by spying the application through QTP?

      Yes :)

  • GP March 29, 2010, 5:46 am

    Hi Anshoo,

    While exporting my test results to excel i am getting an error saying that “A general error occurred while exporting sheet C:\AutomationSuite\Automation\Logs\ExcelLogs\Res1\S6.xls to file S6_Result.
    Function file: C:\AutomationSuite\Automation\Configuration\Access.vbs
    Line (303): ” DataTable.ExportSheet strResultfile, g_strResult”.”……

    Note : First test case status successfully exported to excel and for second test case it is giving the error message……….

    Please help me out in this regard…….

    Thanks in advacne………

    Thanks,
    Prasad G

    • Anshoo Arora March 29, 2010, 9:03 pm

      How large is the sheet for the 2nd test case? Can you make sure it does not exceed the Datatable/Excel version limitations? Also, run the first test case only, then try to open the Excel sheet and see if it opens?

    • GP March 30, 2010, 3:11 am

      Hi Anshoo,

      Thanks for quick responce…

      For the first case status summary successfully exported to excel and i can able to open that also.

      When i run the second test case then it throws an error saying that “A general error occurred while exporting sheet C:\AutomationSuite\Automation\Logs\ExcelLogs\Res1\S6.xls to file S6_Result.
      Function file: C:\AutomationSuite\Automation\Configuration\Access.vbs
      Line (303): ” DataTable.ExportSheet strResultfile, g_strResult”.”……

      Please help me in this regard and thanks in advance…..

      Thanks,
      GP

    • Anshoo Arora April 1, 2010, 7:40 pm

      I think GP you may be exceeding the WorkSheet limitations. Can you try to create a separate data-sheet for the 2nd iteration and see if that helps? Or, only export the important columns?

      What version of Excel do you have? How many columns in the 2nd iteration?

    • Anonymous April 8, 2010, 7:40 am

      Hi Anshoo,

      I am really helpful with your website and the comments from you.

      I am using excel 2003 and i have 7 columns in each test case……
      If i am using single action then i can able to export the summary for more than one test case .I am automating the application
      using actions if i tried to use more than one action for exporting the test summary then it is giving error message otherwise everything
      is fine.

      Please let me know this is a problem because of this action concept if not please provide me some helpful code to come out of the
      issue.

      Thanks in advance…….

      GP

  • bhavi March 23, 2010, 11:10 am

    Anshoo,

    While reviewing your code i do have following questions
    - If the code is written to work in 9.2 version whats the point of having a check for version again?
    - I saw few of the known issues like script kept on running, the execute n is not working for me etc..

    But overall this is good script to start for all mostly someone who is new as i will keep reviewing you script more and i will update my feedback.

    Good job!

    • Anshoo Arora March 23, 2010, 11:33 am

      If the code is written to work in 9.2 version whats the point of having a check for version again?

      The code is written for work for versions 9.2+, which is because DOTNetFactory is not supported for previous versions. If you followed the comments of this article, you will see that a few people had versions 8.2, 9.0 etc and weren’t able to execute this framework. Its to ensure that such issues do not arise.

      I saw few of the known issues like script kept on running, the execute n is not working for me etc..

      I was quite sure that issues were bound to be there, especially for this first version. Not sure why Execute N didn’t work for you though – its been tested by the beta testers and I wasn’t reported any issues with that particular functionality. However, there are certainly some limitations with this framework and they were bound to be for a demo project.

      The script generally keeps on running, can’t be stopped because QTP has some issues stopping code that runs in Classes. Not sure why it occurs, and not sure when it will be resolved :)

    • Anshoo Arora March 23, 2010, 11:34 am

      Bhavi- Thanks for the great feedback!!

  • Sirisha March 20, 2010, 2:28 pm

    It is displaying the error “Function file: C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Libraries\Implementor.vbs
    Line (524): ” Report micFail, “IsEventValid”, “Invalid Event found on Row: ” & iRow & _”.”

    • Anshoo Arora March 23, 2010, 9:54 am

      Ah! This is an Invalid Event error. One of the events that you are using for one of the objects is not valid. Would need to see your Excel Sheet to be sure..

  • Sirisha March 20, 2010, 8:49 am

    hi Anshoo,
    I tried your framework on our web application, I gave the parameters as

    Parent			Child		Description	        Event	     Value
    Browser		                Application	        Launch	     http:////
    Browser Page	WebList	    name:=usertype	    Select	     Administrator
    Browser		                Application         Sync	
    Browser Page	WebEdit	    name:=username	    Set	         administrator
    Browser Page	WebEdit	    name:=password	    Set	         admin
    Browser Page	WebList	    name:=sseid	        Select	     Administrator
    Browser Page	WebButton	name:=Login	        Click	
    Browser         Application	                    Sync	
    

    The test is running but getting failed for a simple login. Am unable to understand the reason, Is there any change required to be done in Engine.vbs file to implement in our applications. Please guide.

    • Anshoo Arora March 23, 2010, 9:53 am

      Hi Sirisha,

      Can you please e-mail me your Excel sheet? Everything looks correct here, but having the data organized in the table will give me a better idea as to what needs to be changed.

      My email is anshoo [dot] arora [at] relevantcodes [dot] com.

  • Raj March 15, 2010, 12:02 am

    I couldn’t able to stop the script during replaying time. Please look into this issue.?

    QTP Version: 9.2
    kept Breakpoint @ Engine.Run
    Successfully executed till “If IsFormConform Then”
    then popped up one Form and clicked on “Execute script”.
    unable to continue from this point and could not able stop script running. Tried ‘Stop’ and F4 several times.

  • Peng February 25, 2010, 2:20 pm

    Hi Anshoo,

    Thank you for sharing the framework to us!
    Regarding keyword driven framework, I have a question that I hope you or other people here can help answer me…

    Most of the QTP tests I have created for my current project need some calculations, flow controls and logical checkings in test steps, i.e. the test is not as simple as “CLICK here, CLICK there, Check if the text is ‘abc’…..”. For example, the requirement could be “to pick an item from a table only if the item’s information meets certain conditions” etc.

    I don’t know how keyword driven framework can handle this kind of requirements?
    If I put all these calculations, flow controls and logical checkings in a separate library file (which is I am doing now using data driven framework), then how keyword driven framework and test case specific fucntions work together?

    Thanks in advance!
    Peng

    • Anshoo Arora February 28, 2010, 5:51 pm

      Peng,

      In your situation, Keyword driven may not be the best suited-architecture, even though it will work. RelevantCodes[1]One supports such conditional statements through the Excel table, but I suppose they would not be as easy to handle/understand as compared to when they’re coded out manually.

      Different types of frameworks generally cater to applications that are built a specific way. That is why you see Hybrid frameworks most often as a single methodology is generally not a complete solution. The next version of this framework, which I have recently started working on will feature data-driven + keyword-driven methodologies which may solve some of the limitations the first release contains. However, it will be a while before it will be released :)

    • Peng March 1, 2010, 9:59 am

      Thank you Anshoo.

      Do you plan to include runtime data handling in the next release? e.g. data generated in test 1 needs to be used for test 2…
      How do you control this in your current keyword-driven framework?

      Thanks,
      Peng

    • Anshoo Arora March 1, 2010, 2:22 pm

      Currently, this feature is not supported by our framework. Its definitely possible and I will try to include it in the next release. Thanks! :)

  • Susan February 18, 2010, 11:48 am

    Hi Anshoo, Firstly… this is a terrific website, great content.

    I really love your framework and i would like to use it for my project, currently as i see it works against static values only; I understand you just need to add more columns in the Data.xls to accomidate more test cases…. but what if i had a variation of a 1000 data instances that i need to run against, does the framework support that.

    Cheers
    Susan | QA Lead
    Bank of America Merrill Lynch

    • Anshoo Arora February 19, 2010, 1:27 am

      Thanks Susan :)

      Since this is a demo project and was created for learning/training purposes, I was not able to include many features that would be generally present in a full-fledged implementation. As RelevantCodes[1]One is a Keyword Driven architecture, I’m not sure if it would be a good fit in a data-driven situation. I’m not saying that its not possible, but it would take a lot of effort and time to fill those 1000 rows with Keywords, which would be quite easy if it were a Data-Driven architecture.

    • Susan February 19, 2010, 11:04 am

      Thanks Anshoo.

      Is there any article that you have written on the data driven framework?

      Cheers
      Susan | QA Lead
      Bank of America Merrill Lynch

    • Anshoo Arora February 24, 2010, 8:05 am

      Hi Susan,

      Unfortunately, I haven’t written anything on Data-Driven methodology yet. I have been planning on creating a simple data-driven framework for a long time, but I haven’t had as much time recently as I would like to work on something like that. Maybe, in the next version of RelevantCodes[1]One, I will try to couple data-driven methodology along with its existing Keyword driven and make it a hybrid framework. I’m not exactly sure when the next version will be released, but I should post something as soon as I have completed some of its deliverables.

  • vaid February 16, 2010, 11:21 pm

    Hi Anshoo,

    First of all I want to thank you for sharing framework with us.

    I have one query regarding test case 003 in your excel sheet. Actually after row 13 ( where you are activating Flights Table Dialog) I want to add new row in this test case which will select say third value from WinList right after when this dialog appears. I will be helpful if you will let me know how I can select any particular value from WinList (in our case From here) using your spreadsheet?

    Currently after Flights Table Dialog appears then you are simply clicking OK(by default it is taking first value). I am interested in selecting any particular value(say third value)

    Thanks again.

    • Anshoo Arora February 17, 2010, 8:45 am

      Hi Vaid,

      What you’re trying to do can surely be done quite easily. It will just require inserting a row in-between the current actions. For guidance, there are 7 examples in this article which you can refer to and if you get stuck, please let me know and I will try to provide the required keywords for that action. Generally, if you would like to select a value in the list, you would just need to provide the description of the WinList object and the value that you would like to select.

  • Bharat February 14, 2010, 2:26 pm

    Brother,

    Thanks for ur quick reply. Keep this good work up.

    Regards
    Bharat

  • GP February 13, 2010, 3:34 am

    Hi Sir,
    I installed excel2007 and QTP10 at my pc, currently once I try to import datasheet from excel2007 file which format is ‘.xlsx’ to a reusable action, it’s not working properly. Even I saved as old format ‘.xls’ but open by excel2007, it’s still not working.

    is it because QTP10 still not support excel 2007 or any other reason?

    I just used the following method.

    DataTable.ImportSheet FilePath, SourceSheetName, DestinationSheetName

    kindly share with me your experience.

    Thanks in advance.

  • Bharat February 11, 2010, 1:25 pm

    Hi Anshoo,

    I have no words to appriciate ur work as there are lots of forums regarding automation tools but no one provided such a valueable matter as u did.

    I have downloaded ur kit but not able to download the youtube clips to get more clear picture about this framework to start with.

    when i tried to download all the three clips using youtube downloader..got the following answer.

    “this url not available on youtube”.

    Can u pls guide me how to download these 3 clips?

    Waiting for ur reply with very keen eyes.

    Thanks
    Bharat

  • GP February 11, 2010, 7:30 am

    Hi Sir,

    Can you please provide the code for exporting resutls to HTML after test execution? It will be very helpful to me.

    • Anshoo Arora February 11, 2010, 2:17 pm

      Hi GP,

      What QTP version are you using?

    • GP February 12, 2010, 10:39 am

      Hi Sir,

      I am using QTP 10.0 version.

      Please provide the code…..

    • Anshoo Arora February 14, 2010, 1:58 am

      Hi GP,

      Can you please provide the exact code you’re using? Eg:

      DataTable.ImportSheet "C:\Test.xls", 1, "Global" 
      
    • GP February 14, 2010, 9:11 am

      Hi Sir,

      I am using the following code.The code working fine and the problem is ,I Could see that the Results_Detailed.html files created has only Report and Test sections without any result data, the page is blank.

      I have placed reults.css file also correctlt in HTML folder.

      Please give me the solution for this.

      Dim xmlSource
      Dim xmlXForm
      Dim strErr
      Dim strResult

      Dim fso, file
      Dim strPath
      Const ForWriting = 2

      Set xmlSource = CreateObject(“MSXML.DOMDocument”)
      Set xmlXForm = CreateObject(“MSXML.DOMDocument”)

      xmlSource.validateOnParse = True
      xmlXForm.validateOnParse = True
      xmlSource.async = False
      xmlXForm.async = False

      xmlSource.Load “C:\AutomationSuite\Automation\scripts\Test1\Res1\Report\Result.xml”

      If Err.Number 0 Then
      strErr = Err.Description & vbCrLf
      strErr = strErr & xmlSource.parseError.reason & ” line: ” & _
      xmlSource.parseError.Line & ” col: ” & _
      xmlSource.parseError.linepos & _
      ” text: ” & xmlSource.parseError.srcText
      MsgBox strErr, vbCritical, “Error loading the XML”

      End If

      xmlXForm.Load “C:\Program Files\HP\QuickTest Professional\dat\PDetails.xsl”

      If Err.Number 0 Then

      strErr = Err.Description & vbCrLf
      strErr = strErr & xmlSource.parseError.reason & ” line: ” & _
      xmlSource.parseError.Line & ” col: ” & _
      xmlSource.parseError.linepos & _
      ” text: ” & xmlSource.parseError.srcText
      MsgBox strErr, vbCritical, “Error loading the Transform”
      End If

      strResult = xmlSource.transformNode(xmlXForm)

      If Err.Number 0 Then

      strErr = Err.Description & vbCrLf

      strErr = strErr & xmlSource.parseError.reason & _
      ” line: ” & xmlSource.parseError.Line & _
      ” col: ” & xmlSource.parseError.linepos & _
      ” text: ” & xmlSource.parseError.srcText

      MsgBox strErr, vbCritical, “Error executing the Transform”

      End If

      Set fso = CreateObject(“Scripting.FileSystemObject”)

      ‘Here you need to update your Output files
      strPath = “c:\TestReport.html”

      ‘ open the file
      Set file = fso.opentextfile(strPath, ForWriting, True)

      ‘ write the info to the file
      file.write strResult

      ‘ close and clean up
      file.Close

    • Anshoo Arora February 15, 2010, 12:41 pm

      GP, this seems like a different issue? I will look into this code sometime today and post my findings here.

    • GP February 15, 2010, 12:59 pm

      Hi Sir,

      Code is working…thank you very much for your support….

      Can you please give some idea on Recovery scenario? How to prepare the functions and how to use the same?It is very important and useful to me.

      Thanks,
      GP

    • Anshoo Arora February 15, 2010, 1:47 pm

      GP, there is an article on Recovery Scenarios that can be found here. I hope you find it helpful.

    • GP February 16, 2010, 6:26 am

      Hi Sir,

      I already read the article,but not able to get the idea how to write the function (for ex:pop up) and how to use the same in QTP.Is it necessary to add the objects in the recovery scenario manager to write the function?
      Thanks,
      GP

    • Anshoo Arora February 17, 2010, 8:43 am

      Its not necessary to add objects, as most pop-ups can be handled through simple Descriptive Programming. I can write a quick article on this topic, but the reason why I chose not to was because there are plenty of places where this topic is already written about. What kind of a pop-up is this, though?

    • GP February 18, 2010, 9:35 am

      Hi Sir,

      I nedd to run this function after test execution only.Please give me the solution for this.

      I am waiting for your reply….

      Thanks,
      GP

    • Anshoo Arora February 19, 2010, 2:20 am

      You can add the following function in the Recovery Scenario manager to handle pop-ups:

      Function_RecoveryHandlePopup(Object)
      	With Dialog("micclass:=Dialog")
      		If .WinButton("text:=&Yes").Exist(0) Then
      			.WinButton("text:=&Yes").Click
      		ElseIf .WinButton("text:=OK").Exist(0) Then
      			.WinButton("text:=OK").Click
      		End If
      	End With
      End Function
      

      Its quite a basic implementation, but you can modify it as per your needs.

    • GP February 19, 2010, 4:15 am

      Thanks and i will try this……..and let you know…..

    • GP February 19, 2010, 4:22 am

      Hi Sir,

      For test results in HTML format, i am facing one problem…..

      I need to run the code for this only after test execution only….Can you please tell me the procedure to run this and get the results in HTML format.

      Thanks in advance.

      Thanks,
      GP

    • Anshoo Arora February 19, 2010, 9:33 am

      GP, I can currently think of 3 ways that can enable exporting of results into HTML:

      1. If you have QTP 10.0, you can manually export the results to HTML at the end of each test.

      2. Open RegEdit
      + HKEY_LOCAL_MACHINE -> SOFTWARE -> Mercury Interactive -> QuickTest Professional -> Logger -> Media -> Log
      + Double click “Active”
      + Change the Value from 0 to 1
      + Restart QTP.

      3. See this thread: http://www.sqaforums.com/printthread.php?Board=UBB20&main=382784&type=post

    • GP February 20, 2010, 8:53 am

      Hi Sir,

      Thanks for the quick reply.
      You have given 3 methods….i am using the third one.

      My query is when exactly i need to call this function (mentioned in thread).I supposed to call after test execution
      finished,but i am not sure how to call this external vbs file.
      If a manually double click on vbs file after test execution,then its working fine….Please give me the solution
      for calling this….Please……

      Thanks in advance,

      Thanks,
      Prasad G

    • Anshoo Arora February 24, 2010, 8:14 am

      GP,

      Since the results cannot be tampered with during run-time, I would suppose that what you’re doing maybe the only correct way. To do this only once, you could include all your tests into an array, and when all of them have completed their execution, run this VBS once for all tests.

    • GP February 24, 2010, 2:45 pm

      Thanks a lot Anshoo……..

    • GP March 3, 2010, 8:39 am

      Thanks a lot Anshoo…….

  • anil February 11, 2010, 12:26 am

    hi
    iam running only demo testcases.
    Demo testcases which are running on only flight reservation application(means windows application).
    step one is passed (browser and newtours opend)but values r not entred into webapplication.IF i will colse the web flight application then tool will opend goolge in that also values r not enterd.if i will colse this one then window flight application opend and working fine.iam not chang any thing in excle files.

    error description:
    [ WebEdit ] Cannot find the “[ WebEdit ]” object’s parent “[ Browser ]” (class Browser). Verify that parent properties
    match an object currently displayed in your application.

    Object’s physical description:
    Mercury Class = Browser
    hwnd = 591216

    • Anshoo Arora February 11, 2010, 1:26 am

      Hi Anil,

      This was a bug in the pre-beta release which was reported by Clive Farrington in the beta testing phase. It was fixed before the release. What you’re seeing generally occurs when you have special character in the description of the browser. Name your browser descriptions without any spaces and no special characters and it should be fine.

    • anil February 11, 2010, 6:10 am

      i didn’t get u r answer.

    • Anshoo Arora February 11, 2010, 2:16 pm

      Anil, I mean, do not use any special character for the browser description. Keep simple names and you won’t see that error..

    • anil February 12, 2010, 1:10 am

      Hi anshoo
      i didn’t use any special character for the browser description.Still it is existing.
      For ex:
      Browser NewTours Launch htp://newtours.demoaut.com (this step is performed well )

      Browser Page WebEdit name:=userName Set test ( value is not set in to webedit)
      Browser Page WebEdit name:=password Set test (value is not ser into webedit)
      here values are not set in to webedit box

    • Anshoo Arora February 14, 2010, 1:53 am

      Hi Anil,

      Your code looks fine, but I’m not sure why you’re seeing this behavior. If I remember correctly, you were using QTP 9.5 and this framework should work well with your version of QTP. Actually, it should work well for versions 9.2 or greater.

      Has there been any code modifications that might cause this issue? Or are you using the code as-is? Its hard to troubleshoot because every PC I have tested the demo, its working. Also, the beta-testers didn’t report any such issues either.

  • GP February 10, 2010, 7:17 am

    Thanks a lot and looking forward for the next release.

  • GP February 9, 2010, 1:31 pm

    Hi Sir,

    I really admired with this framework.

    I am searching for this type of content since one month. But i have one doubt in my mind…Macros are not viewing in excel and we can use this to any application?

    Waiting for your reply.

    • Anshoo Arora February 9, 2010, 11:57 pm

      Hi GP,

      The macros are not available for viewing because there is some code that has been taken from my actual framework, that I use at my clients’ sites. This has also been mentioned in this post. In the next release though, I will write some macros from the scratch and they will all be available for general use.

  • anil February 8, 2010, 1:04 am

    hi anshoo arora
    I tried to use ur framework but iam not unable how to proceed.My proceedings are below like this:
    1.Downloaded ur framework sucessfully at same path wat u mentioned in the article.
    2.I Changed the Data95+.xls to Data.xls,b’cz iam using QTP9.5.and deleted Data92+ sheet .
    3.Next i double clicked the Data.xls and i got security Warning dialog box in that i clciked Enable macros .Now i got excel sheet and i selected Testcase001 and clicked Execute Selected ,runned the Engine and i got a window Execute selector ,in that i clicked Execute Engine! button ,here after i got “Excel work book was not found” .error dialog box.what ever steps u metiond above i followed that one.

    C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Excel Tables
    C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Excel Tables
    CONST sMasterWorkBook = “C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Excel Tables\Data.xls”

    • Anshoo Arora February 8, 2010, 1:27 am

      Can you make sure that your data file is not Data.xls.xls? I remember someone else having the same issue.

    • anil February 8, 2010, 1:51 am

      hi anshoo arora

      Excel sheet problem resolved.But still iam facing another problem. step one is passed (browser and newtours opend)but values r not entred into webapplication.

    • Anshoo Arora February 10, 2010, 12:03 am

      Hi Anil,

      Are you running the demo test cases, or custom (ones you created)?

  • anil February 6, 2010, 12:51 am

    hi .

    iam facing one problem .it is given one error like “EXCEL WORKbook was not found” . how to resolve this issue in this frame work

    • Anshoo Arora February 7, 2010, 8:04 am

      Hi Anil,

      You will have to rename the Excel Table depending upon the version of QTP you are using to Data.xls. Please refer to the “Setting up” part of this post.

  • anil February 6, 2010, 12:31 am

    hi .

    anybody can provied frame work steps one by one .if iam doing work on this i am facing some problems .iam new for qtp 9.5.
    which is helpful for me. pls give the steps

    • Anshoo Arora February 7, 2010, 8:02 am

      Hi Anil,

      Where are you stuck?

  • khang February 5, 2010, 2:26 pm

    thank you for sharing. it’s the best framework i’ve ever seen.

    • Anshoo Arora February 7, 2010, 8:00 am

      Hi Khang,

      I hope you’re doing well.

      Thanks. I’m glad you liked it :)

  • Prabhu February 5, 2010, 2:45 am

    Hi Anshoo,

    I am new to QTP. Pls bear with me if my question is basic/wrong.

    In this framework, where do we need to store the object repository files.

    Prabhu

    • Anshoo Arora February 7, 2010, 7:59 am

      Hi Prabhu,

      This framework doesn’t use OR at all. All programmatic descriptions are supplied via the Excel Table and hierarchies are built at runtime, stored in a collection object and events are performed on them. I haven’t had a chance to start working on the next release, but I will try to incorporate the use of OR.

  • ankit February 5, 2010, 12:02 am

    wow…damn good structure

  • Satishkumar Dega February 1, 2010, 12:18 am

    Hi Anshoo Arora,

    The frame work is working fine.The frame work is very good.
    I have one doubt if I add one vale in data.excel file in test case 1 tthis frame work is work or not?
    I didn’t found any vedios in ur articles can u send some vedios regrading this frame work that is good for me.

    Today I will go through the script files I will ask some questions .

    • Anshoo Arora February 2, 2010, 9:31 pm

      Hi Satishkumar,

      There are 3 videos in this post that show the execution of this framework and right below it are the keywords that would be used when DP statements are converted.

      Please feel free to ask any questions that you may have after looking at the function libraries. :)

  • Madhu January 29, 2010, 2:51 pm

    Its Resolved working fine now .I saved sheet as Data.xls.xls.

    Now my doubts are :if i want to implemet same framework to google application ,what is my approach.I did not find any qtp scriping like launch application,clicking some botton ,etc

    will u pls help me in this .

    • Anshoo Arora January 29, 2010, 2:54 pm

      Madhu,

      In this post, right below the Flash/YouTube videos, you will see a few examples of converting DP statements into RelevantCodes[1]One keywords. You can use that as a guide to creating your own tests. Also, in Test Case 002, there are some keywords used for the Google website, which might be helpful as well.

      Good luck! :)

  • Madhu January 29, 2010, 2:22 pm

    Sorry its a typo mistake,path is same as u mentioned:

    C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Excel Tables

    • Anshoo Arora January 29, 2010, 2:27 pm

      Typo again?

      Well, since the libraries are loaded and the Execution Selector appears, I’m assuming the table should be in the correct location. Can you also verify the name of the file? Is it Data.xls, or Data.xls.xls after you renamed it?

      I’m not sure why you’re seeing this issue. Everything looks good..

    • Anshoo Arora January 29, 2010, 2:34 pm
  • Madhu January 29, 2010, 2:11 pm

    Yes exactly Anshoo,below is the path:

    C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Excel Tables

    • Anshoo Arora January 29, 2010, 2:16 pm

      You stated the path as:

      C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Excel Tables

      but, its supposed to be:

      C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources\Excel Tables

      I think all your steps are correct. Its just the location of the Data Table that needs to be fixed. The error that you see is because the location of the Table as shown in the Data.vbs library which should be:

      CONST sMasterWorkBook = "C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources\Excel Tables\Data.xls"
  • Madhu January 29, 2010, 1:46 pm

    Hi Anshoo,
    I worked individual Automation tasks,but i didn’t never used any framework yet.I tried to use ur framework but iam not unable how to proceed.My proceedings are below like this:
    1.Downloaded ur framework sucessfully at same path wat u mentioned in the article.
    2.I Changed the Data92.xls to Data.xls,b’cz iam using QTP9.2.and deleted Data95+ sheet .
    3.Next i double clicked the Data.xls and i got security Warning dialog box in that i clciked Enable macros .Now i got excel sheet and i selected Testcase001 and clicked Execute Selected ,runned the Engine and i got a window Execute selector ,in that i clicked Execute Engine! button ,here after i got “Excel work book was not found” .error dialog box.

    please help out how can i use this framework ?Is any code is required to run this ,hw can i give test data,how can implement to other applications using this framework?
    Pls help me out …Once i will know its great for me to knowing the framework uses.Previously purely i developed scripts in the QTP for each scenario and used that scripts .so iam confused the approach to implement framework.pls Anshoo help me ,its great for me.

    Regards
    Madhu

    • Anshoo Arora January 29, 2010, 1:59 pm

      Hi Madhu,

      What is the location of the Data Table? Is it located in the following directory:

      C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources\Excel Tables
      
  • Subhash Bohra January 28, 2010, 4:51 am

    Hi

    I liked the framework and it is covering quite a functionalities… I hope and sure you might be covering other application support in coming release like same framework will work for Java, Seible, Web, Windows, MainFrame, PB applications.

    I have sent you a message regarding PB issue… hope to hear from you back soon. Few years back I also created such framework and you can say am not that good at programming or laziness… the code which you wrote is far better then what I wrote that time.. i can see now i have improved my coding a bit… yet a long way to go !!!

    Thank you for sharing your work and helping me and am sure others out

    Great Work !!! Kudos !!!

    -Subhash

    • Anshoo Arora January 28, 2010, 11:05 am

      Hi Subash,

      Just send you an e-mail.

      I hope and sure you might be covering other application support in coming release like same framework will work for Java, Seible, Web, Windows, MainFrame, PB applications.

      I will surely try if I can find applications that run on the mentioned technologies as well as their add-ins. :)

  • daim phillips January 28, 2010, 2:41 am

    Same problem with me. I have already sent an attachment and bug report

    • Anshoo Arora January 28, 2010, 11:02 am

      Hi Daim,

      Just sent you an e-mail.

  • NareN January 28, 2010, 1:48 am

    Hi Anshoo,

    Can you please tell us what are the driving parameters for Automation Framework?

    • Anshoo Arora January 28, 2010, 11:07 am

      Hi NareN,

      I’m not sure if I completely understand your question. What are driving parameters and for what type of framework?

    • NareN January 29, 2010, 12:20 am

      Hi Anshoo,
      What i mean to ask here is…before we are going to select any Automation Framework.. what things/parameters do we need to consider or look into to select an automation framework (any type of automation framework – Keyword/Hybrid/DD). Will this change based on the type of framework we prefer?

      Thank You.
      -Narendra

    • Anshoo Arora January 29, 2010, 2:07 pm

      Actually, this depends on the type of application and the type of testing performed. Using a single framework on all types of application is generally not feasible. The following document: Choosing a test automation framework is an excellent read concerning the topic of automation frameworks and shows how different frameworks can be created and what their use is.

      The thing about a Keyword Driven framework is that, you can make it generic, or make it adapt to several technologies. That’s the reason why I chose to create this type of framework, which is easy to understand and use.

      For example, if I were to create a framework for an application that ONLY has a registration component, ie. only data is supposed to be loaded, I would create a data-driven framework.

      I generally do not use, or bother about which type of framework I am using as long as the user is happy with the level of automation being created. This is only theory. Its more important to understand your application first, then determine what architecture will best fit the needs of your team. With that said, I think, I generally create Hybrid Frameworks most often.

    • NareN February 1, 2010, 12:08 am

      Hi Anshoo,
      Thank you very much for the reply.
      -Narendra.

  • Satishkumar Dega January 28, 2010, 1:08 am

    Hi Anshoo Arora,
    Today I saw your QTP frame work it seems to be good but I am unable to run this script .Could you please tell me the step by step how to run this in my QTP 9.2 .
    U know I am the beginner so I am facing difficulties to execute this frame work.please do the needful for me.

    • Anshoo Arora January 28, 2010, 11:09 am

      Hi Satishkumar,

      Where are you stuck? You just have to rename the Data.xls file to be able to execute this framework.. Copied this from the Setting up section of this post:

      1. Download, unzip and copy the RelevantCodes folder to your “C:\”. The folder structure should look exactly like:

      C:\RelevantCodes\RelevantCodes[1]One\0.1

      2. In the folder C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources\Excel Tables: change the name of the relevant table to Data.xls. If you are using QTP 9.2 or below, rename Data92.xls to Data.xls. For versions 9.5 and higher, rename Data95+.xls to Data.xls.

    • Satishkumar Dega January 29, 2010, 12:12 am

      Hi Anshoo Arora,

      I am using QTP9.2 version.I have copied all the things one folder my path like this
      C:\Documents and Settings\satishkd.SKYTECH\Desktop\TestingDocs\QTP\QTP_SKYResume\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Excel Tables
      I have also change the Data92.xls to Data.xls and also I ahve change the Data.vbs file change the path like
      CONST sMasterWorkBook = “C:\Documents and Settings\satishkd.SKYTECH\Desktop\TestingDocs\QTP\QTP_SKYResume\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Excel Tables\Data.xls”
      after that I have adding all libraries file to in run setings like
      file–>Settings–>run–>adding the location of the lib files is it correct way I am doing tell me

      Any how give me the step by step explanation plz do the need full for me

    • Anshoo Arora January 29, 2010, 1:54 pm

      Hi Satishkumar,

      I’m not sure why you’re having this error. But, your approach seems valid if you have linked the libraries to the test. Just to make sure, can you download the folder to your C drive and see if it works? In other words, your folder structure should be:

      C:\RelevantCodes\RelevantCodes[1]One\0.1
      

      and the child folder are included in the above folder:

      C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources
      C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources\Excel Tables
      C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources\Libraries
      

      After this, rename the correct Excel Table (Data92.xls) and try to execute your script.

  • daim phillips January 27, 2010, 5:50 am
    Browser			Launch	http://XYZ.com
    Browser Page	WebEdit	name:=mainForm:txtLogin	Set	hmis
    Browser Page	WebEdit	name:=mainForm:secPassword	Set	hmis
    Browser Page	Webbutton	name:=Login	Click	
    Browser Page	name:=Hms	Sync	
    Browser Page	Link	text:=Manage Type	Click	
    Browser Page	WebEdit	name:=mainForm:txtDescription	Set	New Description
    Browser Page	webEdit	name:=mainForm:txtType	Set	QTP Testing
    Browser Page	WebButton	name:=Save	Click
    
    • Anshoo Arora January 27, 2010, 6:10 am

      Daim,

      I hope this works well for you:

      Parent       | Child      | Description                    | Event   | Value
      ---------------------------------------------------------------------------------------------
      Browser      |            | XYZ                            | Launch  | http://xyz.com
      Browser Page | WebEdit    | name:=mainForm:txtLogin        | Set     | hmis
      Browser Page | WebEdit    | name:=mainForm:secPassword     | Set     | hmis
      Browser Page | WebButton  | name:=Login                    | Click   |
      Browser      |            | XYZ                            | Sync    |
      Browser Page | Link       | text:=Manage Type              | Click   |
      Browser Page | WebEdit    | name:=mainForm:txtDescription  | Set     | New Description
      Browser Page | WebEdit    | name:=mainForm:txtType         | Set     | QTP Testing
      Browser Page | WebButton  | name:=Save                     | Click   |
      

      Notice how I have given the Browser a name. Whenever there is an interaction with the browser, the same name will be used. Another example with a few keywords for Yahoo Login page that were created for a Relevant Codes participant:

      Parent       | Child      | Description       | Event  | Value
      ---------------------------------------------------------------------------------------------
      Browser	     |            | YahooMail         | Launch | http://www.yahoomail.com/
      Browser Page |  WebEdit	  | html id:=username |	Set	   | username
      Browser Page |  WebEdit	  | html id:=passwd   | Set	   | password
      Browser Page |  WebButton | html id:=.save    | Click      | 	
      
    • daim phillips January 27, 2010, 6:49 am

      Invalid Event found on Row: 4. Test Case 001 will now exit.
      Can I send you attachment, just to confirm you what I am doing.

      I also added the Yahoo example in another test
      It didn’t give me any error, but it didn’t run as well

      Initiating Test Case 002

      Here is what I did in Engine file

      Option Explicit
      
      Public TestData
      
      PUBLIC Data		'Holds . Its loaded each time a new test case 
      				'is executed. See Run method of clsEngine.
      				
      PUBLIC Engine : Set Engine = New clsEngine
      
      Class clsEngine
          Private bCustom	'.NETFactory Form: Custom Execution
          Private bRestart	'.NETFactory Form: Restart Execution (Next release)
          Private bResume	'.NETFactory Form: Resume Execution (Next release)
          Private intContext	'Reporter LogEvent (See SetReporterContext)
          Private oMe		'Region Reference
          Private Implementor	'Instance of Class clsImplementor (Implementor.vbs)
          'Private TestData	'Instance of Class clsTestData (Data.vbs)
    • Anshoo Arora January 27, 2010, 6:57 am

      Sure. You can send your e-mail to: anshoo.arora [at] relevantcodes.com.

      I think its a minor error in the keyword. Else, it should run well.

    • daim phillips January 27, 2010, 7:50 am

      Please refer to attachment in your email

  • daim phillips January 27, 2010, 5:44 am

    I made a mistake. I did not insert Public TestData above line3. Instead, I renamed Public Data to Public TestData

    This time, I didn’t get the error message, but there was no processing as well. The Results stated as “Done” with Description “Initiating Test Case 001″

    • Anshoo Arora January 27, 2010, 6:00 am

      No problem :)

      I have included a few examples of creating keywords from DP statements right below the Videos. I will update it with a few more.

  • daim phillips January 27, 2010, 5:40 am

    keywords: customize test case in Data.xls
    keywords: customize test cases by modifying object properties

    • Anshoo Arora January 27, 2010, 5:45 am

      Daim,

      The error that you were able to generate is because of an invalid event that the framework does not support. It can also be due to using an event that an object does not support. For example, if you use the event Set with Image object, it will generate that error.

      If you can write a few lines of DP code for an application, I can generate the keywords for you so you can have a head start on using this framework to test your application.

      Still, a word of warning: This is a demo project and only a demonstration of how a keyword-driven framework can be formed. Its not an actual implementation, even though its quite close to one..

    • daim phillips January 27, 2010, 5:52 am

      If i used this excel sheet for input data to a test, should I call it a data driven framework? If no, then what can be stated as data driven framework? Can you provide example?

    • daim phillips January 27, 2010, 5:53 am

      e.g.

      login password
      1 1
      2 2
      3 3
      4 4

      where I instructed QTP to take login values one by one in each iteration to run the test.

    • Anshoo Arora January 27, 2010, 6:17 am

      Well, a data-driven framework has several modules that are tailored to the application at hand. These modules only drive data to the application. A few examples of columns you would generally find in a data-driven framework:

      UserName  |  Password  |  Profile  |  Age  |  CreditCardNumber    |  Address    |
      ----------------------------------------------------------------------------------------
      John      | test123    |  Admin    | 32    |  1223 3445 5667 7890 | 123 Fake St |
      Anna      | test234    |  User     | 30    |  1223 3445 5667 1237 | 234 Fake St |
      

      In other words, all you would see are the data that is to be entered to the application.. not the keywords.

    • daim phillips January 27, 2010, 6:41 am

      Thx for the application.

  • daim phillips January 27, 2010, 5:39 am

    Variable is undefined: ‘Data’
    Function file: C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Libraries\Engine.vbs
    Line (44): ” Set Data = TestData.Load”.

    Now, I got the above error

    • Anshoo Arora January 27, 2010, 5:42 am

      Did you comment Public Data also on Line 3? It’s not supposed to be as-is. The only variable to disable is on line 15: Private TestData, and once that’s done, add Public TestData above Public Data -> which is on line 3.

  • daim phillips January 27, 2010, 5:32 am

    Is there any guidance available to customize it. I have found people with replies having seen any related videos, but i can’t find any.

    • Anshoo Arora January 27, 2010, 5:34 am

      Customize the code? The available keywords? Or both?

  • daim phillips January 27, 2010, 5:24 am

    I have modified the test to run on my application.

    I got the following error message
    Variable is undefined: ‘TestData’
    Function file: C:\RelevantCodes\RelevantCodes[1]One.1\Test Resources\Libraries\Implementor.vbs
    Line (524): ” Report micFail, “IsEventValid”, “Invalid Event found on Row: ” & iRow & _”.

    • Anshoo Arora January 27, 2010, 5:30 am

      Ahh. Daim, you just caught a bug. Thanks!

      In Engine.vbs, comment line #15:

      Private TestData			'Instance of Class clsTestData (Data.vbs)
      

      After that, right above Public Data on line 3 of Engine.vbs, write this method instead:

      Public TestData
      

      I believe that should fix it.

      I will update the post soon with your finding.

      Also, can you please share the keywords that caused this behavior?

  • daim phillips January 27, 2010, 4:55 am

    I can’t see the flash player playing anything or video download link. Can you please guide.

    Regards

  • Scott January 26, 2010, 7:29 am

    Thank you for taking the time to share this and answer questions.
    Well Done!

  • Anil January 25, 2010, 3:19 am

    We have link called postal code search, while execution QTP clicked on postal code search link, than pop-up opened, but it’s not able to identify the objects on the pop-up
    Do I need to add new description for this pop-up?

    Also is there any way to use the breakpoints and object highlight concepts in this framework.

    Thanks you

    • Anshoo Arora January 26, 2010, 10:58 am

      Anil,

      You will have to add description for the Dialog box. Its also the same if description is to be added for a new browser, or an already open browser. Test Case 003 shows how the flight Reservation Window is added after the Login Dialog box closes. In the test case (003), the code to add the new window/dialog is:

      Window	| "" | FlightReservation | Activate | regexpwndtitle:=Flight Reservation
      

      The Activate method can be used to add the object to the collection class manually as well as start working on it simultaneously.

  • Anil January 22, 2010, 2:26 am

    Hi Anshoo,

    I just tried to run the yahoo login function using this framework, I found its setting wrong values in user id and password fields,pls see the details below

    My Test data:

    Browser		name:=Yahoo! Mail: The best web-based email!	Launch	https://login.yahoo.com/config/login_verify2?&.src=ym&rl=1
    Browser Page	WebEdit	html id:=username	Set	*******
    Browser Page	WebEdit	html id:=passwd	Set	*******
    Browser Page	WebButton	name:=Sign In	Click	
    

    The below Output without any error
    New Browser New browser opened: name:=Yahoo! Mail: The best web-based email!
    [ login ].Set “hwnd:=4195740″
    [ passwd ].Set “hwnd:=4195740″
    [ Sign In ].Click

    Am I doing wrong?

    • Anshoo Arora January 24, 2010, 11:02 am

      Hi Anil,

      I have emailed you a spreadsheet that contains the keywords you would need to accomplish this task.

  • Anil January 21, 2010, 10:37 pm

    Hi Anshoo,
    I have few doubts on the frame work, can you clarify. Thanks!

    1) In Data table how to define the “page name” under Parent column, is it required or not? Usually in QTP we write some thing like Brower (“B”).Page (“P”)…so in your frame work we no need to define the page name?

    2) How to test and print the error msgs by inputting invalid data
    3) How to test the object existing or not
    4) How to link the test step number in the result
    5) How to use wait method, I try to add this in data-file, but we need to add some functionality in the framework…Right?

    • Anshoo Arora January 24, 2010, 11:01 am

      Hi Anil,

      Please see my notes below:

      1. The description of Page is not necessary. The framework runs the descriptions of pages as generic strings, therefore, its not required to specify the titles/description of the page object.
      2. This is a limitation of the framework – to report custom messages. If there are enough people, in the next release, we can add a feature to report custom messages even off the Excel spreadsheet.
      3. There is an Exist event which can accomplish this.
      4. Each row will have its independent step number. For example, Row 3 = Step 3, Row 7 = Step 7 and so on..
      5. Wait wasn’t included. I thought the Exist method would suffice, but if required, we can include it in the next release as well.

      Also, since this is a demo framework, I have not included ‘many’ features that I normally would for my client. This should just serve as a base to understanding and using a simple keyword driven framework.

  • Anil January 21, 2010, 10:30 pm

    Hi Anshoo,

    Now I can able to click the login link, in the next page I have to enter userid, but its displaying the below error
    “The parameter is incorrect”, actually it’s correct, I have verified the data is 100% correct and length also correct
    I saw, the user id field if disabled while running, but when I try manually its enabled

    Thank you
    Anil

    • Anshoo Arora January 24, 2010, 11:45 pm

      It may be some other issue, Anil. Possibly with the way the code has been written. This sounds like a bug with the code.

      I can also test it if you want. Is it the Yahoo login page that you’re trying this test on?

  • Anil January 21, 2010, 4:51 am

    got it,no need..sorry

  • Anil January 21, 2010, 4:48 am

    Sorry,Can you give me your e-mail ,i will send the data-file

  • Anil January 21, 2010, 4:28 am

    The test cases for the demo is running fine,
    I have added login page descriptions of my application, this is causing issue.
    I follow your tube video and renamed the data file, I am using QTP10,
    Are there any settings I am missing?

    Thanks
    Anil

    • Anshoo Arora January 21, 2010, 4:29 am

      If you want, you can e-mail me your data-file and I can have a look at it..

  • Anil January 21, 2010, 4:02 am

    I did the same way you said, but no use; pls see the error displayed the test report. For Test case002 and 003 also exit after step1

    Step Name: Test Case 001

    Step Failed

    Object Details Result Time

    Test Case 001 Initiating Test Case 001 Failed 21/1/2010 – 16:54:09

    • Anshoo Arora January 21, 2010, 4:14 am

      The test cases for the demo didn’t run successfully either?

  • Anil January 21, 2010, 3:26 am

    Can just add like belwo under Description column in Data table?
    name:=Login ,sourceIndex:=73

    pls Advice
    Thanks
    Anil

    • Anshoo Arora January 21, 2010, 3:47 am

      You can use the below technique to use multiple descriptions:

      [property1:=value1][property2:=value2]
      

      If more than 2 descriptions required, the same technique is to be used:

      [property1:=value1][property2:=value2][property3:=value3][property4:=value4]
      
  • Anil January 21, 2010, 3:18 am

    Hi Anshoo,

    One issue, on of my page contains two links with same called Login (for different user groups), the name:=Login(is also same for both links, here how to add the description properties in the datasheet? Say name and Index

    While running the above scenario, frame work is not displaying error, just closing browser?
    pls correct me if I am wrong, is there any way to see what is the cause of error in the result file? Or at run time?

    Reg slow issue I do more testing and let you know.

    Thanks Anshoo
    Anil

    • Anshoo Arora January 21, 2010, 3:45 am

      One issue, on of my page contains two links with same called Login (for different user groups), the name:=Login(is also same for both links, here how to add the description properties in the datasheet? Say name and Index

      There is an example in Test Case 002 and Test Case 003 that shows how to use 2 (or more) properties to define an object. To add 2 properties:

      [name:=Login][index:=0]
      

      While running the above scenario, frame work is not displaying error, just closing browser?

      You should see all results in the test results. If you would like to prevent your browser from being closed, you can disable line 68: UnloadSettings. This will not release any object once the test exits. The reason why it closes all applications once the test ends is that if there is any run-time error, the application will not stay open, causing the next test to error out.

  • Anil January 21, 2010, 2:17 am

    I just executed this framework in my pc, its bit slow, is there any setting to speed-up?
    Thanks Anshoo! GOOD JOB

    • Anshoo Arora January 21, 2010, 2:52 am

      Hi Anil,

      Generally the speed at which the test executes depends on several factors, but I have tested this product on several PCs and even the beta testers (Clive, Suni and Mahesh) didn’t report any such issues with performance. The way this framework works is by building all the descriptions from the Excel table, and once all the descriptions are built, it executes each line.

      Do other scripts run fine, and is it this framework that is causing this issue with performance?

  • Amit Saran January 21, 2010, 2:07 am

    Hi Anshu

    Can u post an article on .Net Addin like how we identify controls and use it in our test. It will be great help. And in your Framework excel macros’ codes are password protected can i see it ?
    Sometimes we get error Object Description not found even Object is the in Shared Object Repository. So please also plan to post a article on it.

    Thanks

    • Anshoo Arora January 21, 2010, 2:49 am

      Sure, Amit, I will try my best. I haven’t been able to write much lately because of prior obligations, but as soon as I get a chance, I will try to do some R&D and post my findings here, citing your comment there.

  • Bhavi January 20, 2010, 1:14 pm

    Hey Anshoo,

    Its not related anything above but i just want to findout how is QTP and JS errors are related? Please explain to me this as whats happening is when ever i have JS error on IE then my qtp scripts are getting fails is there any work around so suggest?

    • Anshoo Arora January 21, 2010, 2:47 am

      In my knowledge, there shouldn’t be any correlation between the two, but what kind of JS errors are these? Are there any examples that I would be able to test upon? Also, are you certain that your script fails due to JS errors?

    • ANO April 15, 2010, 7:14 am

      Hi Anil
      if I have the statement:
      browser(“”).Page(“”).Frame(“”).WebEdit(“”).FireEvent “onfocus”
      how can i use the Framework
      thanks for your Framework
      Good Work!

    • ANO April 15, 2010, 7:22 am

      Hi Anil
      Another question, I want to set the PropertiesColl(Property).RegularExpression to FALSE, exclude “\”,
      please tell me how can I do?
      thanks!

    • Anshoo Arora April 19, 2010, 10:22 pm

      This is not directly possible, but there is a workaround. You can include a \ before the Regexp meta-characters to replicate the same behavior.

    • Anshoo Arora April 19, 2010, 10:21 pm

      Hi Ano,

      This framework does not support FireEvent :(

      Its a limitation.

  • Amit Saran January 20, 2010, 7:45 am

    Hi Anshu
    Thanks so much for such a precious post. Coz i have never found any demo of Framework anywhere. It gives the real idea to all the guys who wants to know about Automation Framework and find only the definition on internet.
    Keep it up man…….

    Thanks Once Again

    • Anshoo Arora January 20, 2010, 9:29 am

      I’m glad it helped you, Amit. :)

  • Arun January 15, 2010, 5:27 am

    Anshoo,

    Can i view the source code of macro?

    Thanks,
    Arun

    • Anshoo Arora January 15, 2010, 5:34 am

      It is still under development, but you can surely view it:

      Private Sub CreateNewTestCase_Click()
      	Dim intUsedColumns
      
      	intUsedColumns = Me.UsedRange.Columns.Count
      
      	Me.Columns("B:F").Copy Me.Columns(Number2Char(Me.UsedRange.Columns.Count + 1) & ":" & Number2Char(Me.UsedRange.Columns.Count + 5))
      	Me.Columns(Number2Char(Me.UsedRange.Columns.Count - 4) & ":" & Number2Char(Me.UsedRange.Columns.Count)).EntireColumn.Clear
      End Sub
      

      It requires a bit of tweaking because for the release, I switched a few things around. I will get it to work soon and maybe load the new spreadsheet separately for everyone to download.

    • Arun January 15, 2010, 5:44 am

      I was asking you for the source code of the existing macro (Find Test,Prev, Next).

      When i was trying to view the Macro through VB Editor it is showing as password protected, i just wanted to see how you have handled the functionality through Excel.

      Thanks,
      Arun

    • Anshoo Arora January 15, 2010, 6:18 am

      Some of the macros are from my actual framework, therefore, they have been password protected. This has also been mentioned in this post, under Features:

      Data Sheet with Custom Macros (macros will not available for viewing)

  • Arun January 15, 2010, 4:30 am

    Anshoo,

    How to add Test case 005 into the Data.xls?

    • Anshoo Arora January 15, 2010, 4:57 am

      There is currently a macro in the spreadsheet that will automatically create all the columns for a new test case. However, I have not included it in this release. It will be available in version 0.2 beta.

      For now, the only option is to copy all 5 columns right after test case 004..

  • Arun January 14, 2010, 2:10 am

    Hi Anshoo,

    I have gone through your frame work and it is really good.

    When i select the Action1 and execute the script all the four test cases are executed, can you please ket me know how to execute a single test case in one go?

    I have tried selecting next test case from Data XL by clicking on next button but non of the buttons are working for me.

    Also can you please explain me the purpose of the “Contents” sheet in Data.Xls?

    Thanks,
    Arun

    • Anshoo Arora January 14, 2010, 2:16 am

      Hi Arun,

      I am really glad you liked the framework.

      1. To run the selected test cases, you will have to switch the Execute Y to Execute N. This will enable you to run only a few test cases out of a group of test cases. If you view the first video of this article/post, you will see that I only execute the very first test case out of the 4 available test cases..

      2. The Contents Sheet contains the values that are used as drop-down lists in the main test-case sheet.

    • Arun January 14, 2010, 2:35 am

      Thanks for a very quick reply

      I have tried selecting next test case from Data XL by clicking on next button but non of the buttons are working for me?

      I dont have access to view the demo out here, so please let me know how to change the execution status to NO for rest of the tests.

    • Anshoo Arora January 14, 2010, 3:01 am

      What is your Office version? 2003? 2007?

    • Arun January 14, 2010, 3:07 am

      Its 2003

    • Anshoo Arora January 14, 2010, 3:19 am

      See this document. It will help you enable ActiveX controls.

    • Anshoo Arora January 14, 2010, 4:58 am

      Arun, were you able to enable ActiveX controls on the spreadsheet? Once that is done, I think, you should be able to use the custom button controls to navigate through the sheet.

    • Arun January 15, 2010, 4:07 am

      Anshoo,

      It is working for me when i turn the Macro Security level to Low.

      Thanks,
      Arun

    • Anshoo Arora January 15, 2010, 4:54 am

      Great!!

  • Jayachandra January 12, 2010, 5:21 am

    S Anshoo its in .odp

    • Anshoo Arora January 12, 2010, 6:09 am

      Please see this thread. Also, you might be able to find some valuable information on OpenOffice and VB here.

  • Jayachandra January 12, 2010, 2:10 am

    HI Anshoo,

    Please answer to my question regarding working with “ODS” instead of excel as im working on open office.
    thnxs in advance.

    • Anshoo Arora January 12, 2010, 4:10 am

      Hi Jayachandra,

      Do you mean “.odp” file format, or a operational data store?

  • Joe Loyzaga January 11, 2010, 4:12 pm

    I’m finding that the browsers I have opened are automatically closed on completion/stopping of script – am I right? Can this be stopped?

    • Anshoo Arora January 11, 2010, 11:39 pm

      Sure can!

      In Implementor.vbs -> comment out (disable) the statement -> UnloadSettings

      Once you disable this line, the applications will not shut down once the run is complete.

  • Ankur Gupta January 11, 2010, 7:40 am

    Dear sir,
    i m still waiting for ur response…

    • Anshoo Arora January 12, 2010, 2:51 pm

      Hi Ankur,

      Please see my above reply:

      I am not able to reproduce this issue on either of my machines. I have 9.2 and 9.5 installed. This may be an issue with Excel or QTP, but its hard to be sure because I don’t have Excel 2003 either.

      Is there a way you can upgrade QTP to 9.2?

  • Ankur Gupta January 11, 2010, 4:40 am

    sir i have selected only first test case as execute Y and all remaing as execute N then i m getting these error
    please help me on this.

    • Anshoo Arora January 11, 2010, 8:15 am

      Hi Ankur,

      I am not able to reproduce this issue on either of my machines. I have 9.2 and 9.5 installed. This may be an issue with Excel or QTP, but its hard to be sure because I don’t have Excel 2003 either.

      Is there a way you can upgrade QTP to 9.2?

  • Ankur Gupta January 11, 2010, 4:20 am

    sir i did all test cases Execute N as ur video mentioned… only first test case is execute Y.
    now again i i face a problem
    i have opened the demo92 test in my qtp and when i run this i m getting an error “Object doesn’t support this property or method: ‘AutoSize’” as ur seconf video.

    suggest me sir

    • Anshoo Arora January 11, 2010, 4:22 am

      You will have to select at least one test case before running this demo..

  • Ankur Gupta January 11, 2010, 4:05 am

    Dear sir,
    i did as ur first video showed but when i clicked on execute selected button it run as ur second video, i think it run for all test cases.

    Also i m getting a alert “MIcrosoft office excel is waiting for another application to complete an OLE action.”

    thanks in advance.

    • Anshoo Arora January 11, 2010, 4:17 am

      To run the selected test cases, you will have to switch the Execute Y to Execute N. This will enable you to run only a few test cases out of a group of test cases.

      Also i m getting a alert “MIcrosoft office excel is waiting for another application to complete an OLE action.”

      Not sure why this has occurred. I haven’t yet seen this, nor did the folks who beta-tested this product..

  • Ankur Gupta January 11, 2010, 3:29 am

    sir
    i did that but i m little bit confused. “copy the contents of the Script.mts”… which file u r talking about?
    actually this file is in both folder Action0 or Action1??

    also i have no knowledge of Dot net factory??
    suggest me.
    thanks in advance.

    • Anshoo Arora January 11, 2010, 3:47 am

      It should be in Action1. Open it in notepad, and copy/paste its contents in the test that you created.

      You can also just copy the code that I have in my above post. Let me know how it goes :)

  • Ankur Gupta January 11, 2010, 2:56 am

    Dear Anshoo,

    I m a learner of qtp and wanna try this but getting a error like “run time eror ’1006′ cant run test”.
    i have changed data92.xls with data.xls and i m using qtp 9.0
    when i click on execute selected button it opens the qtp 9.0 application but then i will get a run time error ’1006′ cant open test.

    please help me on this.

    thanks in advance.

    • Anshoo Arora January 11, 2010, 3:01 am

      Hi Ankur,

      This is a known issue with backward compatibility. I think what you should do is, create a new test, associate all function libraries with the test and copy the contents of the Script.mts file to the test you created. Rename the test as Demo92.

      1. Create new test
      2. Associate all library files with it. Libraries files are located in C:\RelevantCodes\RelevantCodes[1]One\0.1\Test Resources\Libraries
      3. Save it as Demo92 in C:\RelevantCodes\RelevantCodes[1]One\0.1\Tests
      4. In the created test, copy the following:

      Option Explicit
      
      '
      '		Relevant Codes One [1] Automation Framework Demo
      '		Anshoo Arora
      '		0.1
      '
      
      Engine.Run
      

      You’re good to go :)

    • Anshoo Arora January 11, 2010, 3:02 am

      Another thing, I am not sure if DOTNetFactory runs on QTP 9.0, and if it doesn’t, please let me know. You will have to disable it, by commenting a single line of code in Engine.vbs.

    • Ankur Gupta January 11, 2010, 3:03 am

      Dear Anshoo,
      I think problem is with my qtp 9.0 version because when i opened the test script “Demo92″ manually i will get a error like “This document was modified using a later version of Quick Test. you cann’t open it with the currently installed version of Quicktest.”

      What should i do??

      please help me on this.

      thanks in advance.

    • Anshoo Arora January 11, 2010, 3:04 am

      No need to worry, Ankur :)

      Please follow the above 4 steps, and it should work.

  • Joe Loyzaga January 10, 2010, 4:43 pm

    the description column – did you programatically work this out or was it free hand? if it was freehand then whats the syntax? – does it matter?

    Thats all for now!

    Joe

    • Anshoo Arora January 10, 2010, 9:17 pm

      For single descriptions, you can code it out like this:

      property:=value

      For multiple descriptions, its a little different (notice the [ ] for property/value pairs):

      [property:=value][property:=value][property:=value]

      Please remember that this is just a framework demo, and not a full-fledged framework implementation. So, a few of the technicalities have not been created so its a little easy to understand and use.

    • Joe Loyzaga January 10, 2010, 9:20 pm

      trying to use it to see how much work is left – can’t seem to get passed launching the browser – trying to do a sync now

    • Anshoo Arora January 10, 2010, 9:25 pm

      I received your e-mail. I will send it with a few values to you so you can have a head start.

    • Sikandar January 18, 2010, 4:07 am

      Even i was trying to do a sync and did not work for me..

      Any one has luck in getting the sync work….also tried a set event did not get thru but set event on the Google page works for me!!

    • Anshoo Arora January 18, 2010, 4:37 am

      Sikandar,

      Can I look at your table as well? I would like to see if you’ve set the Keywords in the Excel spreadsheet correctly, especially the descriptions. If it works for Google, it will work for all other pages.

    • Sikandar January 18, 2010, 5:05 am
      Browser		Google	Launch	http://www.google.co.in
      Browser Page	WebEdit	name:=q	Set	test
      Browser Page		Google	Sync	
      Browser		myTest	Launch	http://www.mytest.com
      Browser Page		myTest	Sync	
      Browser Page	WebEdit	name:=qt	Set	myValue
      Browser Page	WebButton	name:=Search	Click
      
    • Sikandar January 18, 2010, 5:21 am

      is submit event supported ?

    • Anshoo Arora January 18, 2010, 5:31 am

      Submit event? Do you mean Click?

    • Anshoo Arora January 18, 2010, 7:13 am

      Try this:

      Browser		Google	Launch	http://google.com
      Browser Page		Google	Sync	
      Browser Page	WebEdit	name:=q	Set	test
      Browser		myTest	Launch	http://mytest.com
      Browser		myTest	Sync	
      Browser Page	WebEdit	html id:=searchtext	Set	myValue
      Browser Page	WebButton	name:=Search	Click	
      
  • Joe Loyzaga January 10, 2010, 4:35 pm

    Anshoo,

    Doing the maths – you need 5 columns for every testcase – that means you can only have just under 50 test cases per worksheet? and to create a new blank test case you just copy the 5 columns (in blank testcase) and then rename it to ? test case 5 and then add this to the test case list in the content worksheet?

    • Anshoo Arora January 10, 2010, 9:15 pm

      Why just 50? Even if you keep a 60,000 limit, you can have 12,000 test cases within the same worksheet.

      In the next release, you will see a control that automatically copies entire 5 columns for new test cases, or creates 5 new columns to start building the new one. The code is already there in the Macro, but I haven’t yet inserted an ActiveX button for it. I was thinking of keeping it for the next release.

    • Joe Loyzaga January 10, 2010, 9:18 pm

      isn’t there a limit of 256 to the number of columns per worksheet hence the 50 testcases…

      Am I wrong? seems I can be – ask my wife!, my children, etc etc etc

    • Anshoo Arora January 10, 2010, 9:23 pm

      Woops! Sorry. I misunderstood it with the number of possible rows.

      This article: http://office.microsoft.com/en-us/excel/HP100738491033.aspx says that the possible worksheet size is 1,048,576 rows by 16,384 columns. That’s 3000+ test cases..

      I think the older versions of Excel supported only 256. I have Excel 2007 in all my PCs so unable to check for 97-2003 version.

  • Joe Loyzaga January 10, 2010, 4:19 pm

    Anshoo

    Do your screencasts have sound?

  • Joe Loyzaga January 8, 2010, 5:44 pm

    Anshoo – looked at your framework – am I to understand that you have 1 worksheet per testcase? so if you have many testcases then you need many worksheets? can’t you use 1 worksheet for many testcases? many more columns? the page field definitions should remain static
    Wouldn’t it speed up the execution of testcases? Please correct me if I’m wrong

    Joe

    • Anshoo Arora January 8, 2010, 11:35 pm

      Joe, all test cases are in the same worksheet. There are 2 control Buttons to the left of the worksheet:

      Prev
      Next

      These 2 control buttons help you navigate from one test case to another. If you see the first video of this post, you will notice that I am navigating between test cases (there are 4) and the 4th test case is empty. The first three test cases have the ‘Execute Y’ flag on which denotes the test case to be executed. The last one has ‘Execute N’ which means, the test case will not be executed.

      All the test cases are loaded in the Data Object as the framework loads and the Excel spreadsheet is not referred to again.

  • Jayachandra January 8, 2010, 12:50 am

    HI Anshoo,

    THnxs really and as a learner i really appreciate and thnxs for all the post and looking forward for some mre snippets which you come across..

  • Bhavi January 6, 2010, 12:17 pm

    Hi Anshoo,

    I have a quick question for you may be you can give me the answer for this? i want to keep running my qtp scripts when my system is locked is there any process or settings can be done? If yes do suggest the process?

    Thanks in advance!

    • Anshoo Arora January 7, 2010, 4:03 am

      Hi Bhavi,

      Please see this thread on SQAForums. There are several solutions in that thread which might help you..

  • Bibek Khatiwara January 6, 2010, 7:55 am

    Anshoo great framework..

    I just want to take this opportunity and say thank you.This is the best shot fired by any QTP blogger. :) I feel that you made it your priority to support the community & really appreciate your extra ordinary work.

    Thank You!

    • Anshoo Arora January 7, 2010, 4:31 am

      Thank you, Bibek. :)

  • bhavi January 5, 2010, 10:57 pm

    Anshoo this is best frame work i ever saw than mine :) i thought mine was good by seeing urs i am just a drop but i didnt know there is ocean out there while seeing urs, u r making me inspired so well.Good job and keep it up! Thanks for sharing with all of us.

    • Anshoo Arora January 5, 2010, 10:58 pm

      Thank you, Bhavi :)