Relevant Codes

A Test Development Resource for HP QuickTest Professional.

RelevantCodes[1]One – QTP Automation Framework

January 4, 2010 · 195 comments

The first release of RelevantCodes[1]One 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 (1244)

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.


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 (1244)

RelevantCodes[1]One Automation Framework

{ 3 trackbacks }

Updates: Upcoming Automation Framework (Relevant Codes One) | Relevant Codes by Anshoo Arora
January 20, 2010 at 11:26 pm
Upcoming: QTP Automation Framework | Relevant Codes by Anshoo Arora
January 20, 2010 at 11:28 pm
Available framework for QTP « Rajeev
January 23, 2010 at 9:52 am

{ 192 comments… read them below or add one }

1 bhavi January 5, 2010 at 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.

Reply

2 Anshoo Arora January 5, 2010 at 10:58 pm

Thank you, Bhavi :)

Reply

3 Bibek Khatiwara January 6, 2010 at 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!

Reply

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

Thank you, Bibek. :)

Reply

5 Bhavi January 6, 2010 at 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!

Reply

6 Anshoo Arora January 7, 2010 at 4:03 am

Hi Bhavi,

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

Reply

7 Jayachandra January 8, 2010 at 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..

Reply

8 Anshoo Arora January 8, 2010 at 1:29 am

Thank you :)

Reply

9 Joe Loyzaga January 8, 2010 at 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

Reply

10 Anshoo Arora January 8, 2010 at 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.

Reply

11 Joe Loyzaga January 10, 2010 at 4:19 pm

Anshoo

Do your screencasts have sound?

Reply

12 Anshoo Arora January 10, 2010 at 9:05 pm

No sound..

Reply

13 Joe Loyzaga January 10, 2010 at 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?

Reply

14 Anshoo Arora January 10, 2010 at 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.

Reply

15 Joe Loyzaga January 10, 2010 at 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

Reply

16 Anshoo Arora January 10, 2010 at 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.

Reply

17 Joe Loyzaga January 10, 2010 at 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

Reply

18 Anshoo Arora January 10, 2010 at 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.

Reply

19 Joe Loyzaga January 10, 2010 at 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

Reply

20 Anshoo Arora January 10, 2010 at 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.

Reply

21 Sikandar January 18, 2010 at 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!!

Reply

22 Anshoo Arora January 18, 2010 at 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.

Reply

23 Sikandar January 18, 2010 at 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

Reply

24 Sikandar January 18, 2010 at 5:21 am

is submit event supported ?

Reply

25 Anshoo Arora January 18, 2010 at 5:31 am

Submit event? Do you mean Click?

Reply

26 Anshoo Arora January 18, 2010 at 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

Reply

27 Ankur Gupta January 11, 2010 at 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.

Reply

28 Anshoo Arora January 11, 2010 at 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 :)

Reply

29 Anshoo Arora January 11, 2010 at 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.

Reply

30 Ankur Gupta January 11, 2010 at 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.

Reply

31 Anshoo Arora January 11, 2010 at 3:04 am

No need to worry, Ankur :)

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

Reply

32 Ankur Gupta January 11, 2010 at 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.

Reply

33 Anshoo Arora January 11, 2010 at 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 :)

Reply

34 Ankur Gupta January 11, 2010 at 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.

Reply

35 Anshoo Arora January 11, 2010 at 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..

Reply

36 Ankur Gupta January 11, 2010 at 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

Reply

37 Anshoo Arora January 11, 2010 at 4:22 am

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

Reply

38 Ankur Gupta January 11, 2010 at 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.

Reply

39 Anshoo Arora January 11, 2010 at 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?

Reply

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

Dear sir,
i m still waiting for ur response…

Reply

41 Anshoo Arora January 12, 2010 at 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?

Reply

42 Joe Loyzaga January 11, 2010 at 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?

Reply

43 Anshoo Arora January 11, 2010 at 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.

Reply

44 Jayachandra January 12, 2010 at 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.

Reply

45 Anshoo Arora January 12, 2010 at 4:10 am

Hi Jayachandra,

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

Reply

46 Jayachandra January 12, 2010 at 5:21 am

S Anshoo its in .odp

Reply

47 Anshoo Arora January 12, 2010 at 6:09 am

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

Reply

48 Arun January 14, 2010 at 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

Reply

49 Anshoo Arora January 14, 2010 at 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.

Reply

50 Arun January 14, 2010 at 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.

Reply

51 Anshoo Arora January 14, 2010 at 3:01 am

What is your Office version? 2003? 2007?

Reply

52 Arun January 14, 2010 at 3:07 am

Its 2003

Reply

53 Anshoo Arora January 14, 2010 at 3:19 am

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

Reply

54 Anshoo Arora January 14, 2010 at 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.

Reply

55 Arun January 15, 2010 at 4:07 am

Anshoo,

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

Thanks,
Arun

Reply

56 Anshoo Arora January 15, 2010 at 4:54 am

Great!!

Reply

57 Arun January 15, 2010 at 4:30 am

Anshoo,

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

Reply

58 Anshoo Arora January 15, 2010 at 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..

Reply

59 Arun January 15, 2010 at 5:27 am

Anshoo,

Can i view the source code of macro?

Thanks,
Arun

Reply

60 Anshoo Arora January 15, 2010 at 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.

Reply

61 Arun January 15, 2010 at 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

Reply

62 Anshoo Arora January 15, 2010 at 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)

Reply

63 Amit Saran January 20, 2010 at 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

Reply

64 Anshoo Arora January 20, 2010 at 9:29 am

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

Reply

65 Bhavi January 20, 2010 at 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?

Reply

66 Anshoo Arora January 21, 2010 at 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?

Reply

67 Amit Saran January 21, 2010 at 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

Reply

68 Anshoo Arora January 21, 2010 at 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.

Reply

69 Anil January 21, 2010 at 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

Reply

70 Anshoo Arora January 21, 2010 at 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?

Reply

71 Anil January 21, 2010 at 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

Reply

72 Anshoo Arora January 21, 2010 at 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.

Reply

73 Anil January 21, 2010 at 3:26 am

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

pls Advice
Thanks
Anil

Reply

74 Anshoo Arora January 21, 2010 at 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]

Reply

75 Anil January 21, 2010 at 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

Reply

76 Anshoo Arora January 21, 2010 at 4:14 am

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

Reply

77 Anil January 21, 2010 at 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

Reply

78 Anshoo Arora January 21, 2010 at 4:29 am

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

Reply

79 Anil January 21, 2010 at 4:48 am

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

Reply

80 Anil January 21, 2010 at 4:51 am

got it,no need..sorry

Reply

81 Anil January 21, 2010 at 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

Reply

82 Anshoo Arora January 24, 2010 at 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?

Reply

83 Anil January 21, 2010 at 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?

Reply

84 Anshoo Arora January 24, 2010 at 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.

Reply

85 Anil January 22, 2010 at 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?

Reply

86 Anshoo Arora January 24, 2010 at 11:02 am

Hi Anil,

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

Reply

87 Anil January 25, 2010 at 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

Reply

88 Anshoo Arora January 26, 2010 at 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.

Reply

89 Scott January 26, 2010 at 7:29 am

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

Reply

90 Anshoo Arora January 26, 2010 at 10:59 am

Thank you, Scott!

Reply

91 daim phillips January 27, 2010 at 4:55 am

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

Regards

Reply

92 Anshoo Arora January 27, 2010 at 4:59 am

Daim,

Not sure why the flash player isn’t working. Is your browser JavaScript enabled and is Flash Player installed?

The download link is at the top and bottom-most locations of this post. Alternatively, you can use the link below to initiate your download:

http://relevantcodes.com/wp-content/plugins/download-monitor/download.php?id=1

Reply

93 daim phillips January 27, 2010 at 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 & _”.

Reply

94 Anshoo Arora January 27, 2010 at 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?

Reply

95 daim phillips January 27, 2010 at 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.

Reply

96 Anshoo Arora January 27, 2010 at 5:34 am

Customize the code? The available keywords? Or both?

Reply

97 daim phillips January 27, 2010 at 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

Reply

98 Anshoo Arora January 27, 2010 at 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.

Reply

99 daim phillips January 27, 2010 at 5:40 am

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

Reply

100 Anshoo Arora January 27, 2010 at 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..

Reply

101 daim phillips January 27, 2010 at 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?

Reply

102 daim phillips January 27, 2010 at 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.

Reply

103 Anshoo Arora January 27, 2010 at 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.

Reply

104 daim phillips January 27, 2010 at 6:41 am

Thx for the application.

Reply

105 daim phillips January 27, 2010 at 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″

Reply

106 Anshoo Arora January 27, 2010 at 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.

Reply

107 daim phillips January 27, 2010 at 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

Reply

108 Anshoo Arora January 27, 2010 at 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      |

Reply

109 daim phillips January 27, 2010 at 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)

Reply

110 Anshoo Arora January 27, 2010 at 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.

Reply

111 daim phillips January 27, 2010 at 7:50 am

Please refer to attachment in your email

Reply

112 Satishkumar Dega January 28, 2010 at 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.

Reply

113 Anshoo Arora January 28, 2010 at 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.

Reply

114 Satishkumar Dega January 29, 2010 at 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

Reply

115 Anshoo Arora January 29, 2010 at 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.

Reply

116 NareN January 28, 2010 at 1:48 am

Hi Anshoo,

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

Reply

117 Anshoo Arora January 28, 2010 at 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?

Reply

118 NareN January 29, 2010 at 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

Reply

119 Anshoo Arora January 29, 2010 at 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.

Reply

120 NareN February 1, 2010 at 12:08 am

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

Reply

121 daim phillips January 28, 2010 at 2:41 am

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

Reply

122 Anshoo Arora January 28, 2010 at 11:02 am

Hi Daim,

Just sent you an e-mail.

Reply

123 Subhash Bohra January 28, 2010 at 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

Reply

124 Anshoo Arora January 28, 2010 at 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. :)

Reply

125 Madhu January 29, 2010 at 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

Reply

126 Anshoo Arora January 29, 2010 at 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

Reply

127 Madhu January 29, 2010 at 2:11 pm

Yes exactly Anshoo,below is the path:

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

Reply

128 Anshoo Arora January 29, 2010 at 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"

Reply

129 Madhu January 29, 2010 at 2:22 pm

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

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

Reply

130 Anshoo Arora January 29, 2010 at 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..

Reply

131 Anshoo Arora January 29, 2010 at 2:34 pm
132 Madhu January 29, 2010 at 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 .

Reply

133 Anshoo Arora January 29, 2010 at 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! :)

Reply

134 Satishkumar Dega February 1, 2010 at 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 .

Reply

135 Anshoo Arora February 2, 2010 at 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. :)

Reply

136 ankit February 5, 2010 at 12:02 am

wow…damn good structure

Reply

137 Prabhu February 5, 2010 at 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

Reply

138 Anshoo Arora February 7, 2010 at 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.

Reply

139 khang February 5, 2010 at 2:26 pm

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

Reply

140 Anshoo Arora February 7, 2010 at 8:00 am

Hi Khang,

I hope you’re doing well.

Thanks. I’m glad you liked it :)

Reply

141 anil February 6, 2010 at 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

Reply

142 Anshoo Arora February 7, 2010 at 8:02 am

Hi Anil,

Where are you stuck?

Reply

143 anil February 6, 2010 at 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

Reply

144 Anshoo Arora February 7, 2010 at 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.

Reply

145 anil February 8, 2010 at 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”

Reply

146 Anshoo Arora February 8, 2010 at 1:27 am

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

Reply

147 anil February 8, 2010 at 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.

Reply

148 Anshoo Arora February 10, 2010 at 12:03 am

Hi Anil,

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

Reply

149 GP February 9, 2010 at 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.

Reply

150 Anshoo Arora February 9, 2010 at 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.

Reply

151 GP February 10, 2010 at 7:17 am

Thanks a lot and looking forward for the next release.

Reply

152 Anshoo Arora February 10, 2010 at 2:07 pm

:)

Reply

153 anil February 11, 2010 at 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

Reply

154 Anshoo Arora February 11, 2010 at 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.

Reply

155 anil February 11, 2010 at 6:10 am

i didn’t get u r answer.

Reply

156 Anshoo Arora February 11, 2010 at 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..

Reply

157 anil February 12, 2010 at 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

Reply

158 Anshoo Arora February 14, 2010 at 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.

Reply

159 GP February 11, 2010 at 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.

Reply

160 Anshoo Arora February 11, 2010 at 2:17 pm

Hi GP,

What QTP version are you using?

Reply

161 GP February 12, 2010 at 10:39 am

Hi Sir,

I am using QTP 10.0 version.

Please provide the code…..

Reply

162 Anshoo Arora February 14, 2010 at 1:58 am

Hi GP,

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

DataTable.ImportSheet "C:\Test.xls", 1, "Global"

Reply

163 GP February 14, 2010 at 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

Reply

164 Anshoo Arora February 15, 2010 at 12:41 pm

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

Reply

165 GP February 15, 2010 at 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

Reply

166 Anshoo Arora February 15, 2010 at 1:47 pm

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

Reply

167 GP February 16, 2010 at 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

Reply

168 Anshoo Arora February 17, 2010 at 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?

169 GP February 18, 2010 at 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

Reply

170 Anshoo Arora February 19, 2010 at 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.

Reply

171 GP February 19, 2010 at 4:15 am

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

Reply

172 GP February 19, 2010 at 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

Reply

173 Anshoo Arora February 19, 2010 at 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

Reply

174 GP February 20, 2010 at 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

Reply

175 Anshoo Arora February 24, 2010 at 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.

176 GP March 3, 2010 at 8:39 am

Thanks a lot Anshoo…….

177 Bharat February 11, 2010 at 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

Reply

178 Anshoo Arora February 11, 2010 at 2:25 pm

Hi Bharat,

Thank you for your compliments. I am glad to have received such positive feedback for this framework from the community.

To answer your question, you should be able to download the videos from one of these 2 sources:

YouTube: http://www.youtube.com/user/anshooarora
Screenr: http://screenr.com/user/anshooarora

Reply

179 GP February 13, 2010 at 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.

Reply

180 Bharat February 14, 2010 at 2:26 pm

Brother,

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

Regards
Bharat

Reply

181 Anshoo Arora February 19, 2010 at 2:15 am

Thanks :)

Reply

182 vaid February 16, 2010 at 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.

Reply

183 Anshoo Arora February 17, 2010 at 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.

Reply

184 Susan February 18, 2010 at 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

Reply

185 Anshoo Arora February 19, 2010 at 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.

Reply

186 Susan February 19, 2010 at 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

Reply

187 Anshoo Arora February 24, 2010 at 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.

Reply

188 Peng February 25, 2010 at 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

Reply

189 Anshoo Arora February 28, 2010 at 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 :)

Reply

190 Peng March 1, 2010 at 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

Reply

191 Anshoo Arora March 1, 2010 at 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! :)

Reply

192 GP February 24, 2010 at 2:45 pm

Thanks a lot Anshoo……..

Reply

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Previous post:

Next post: