The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> AutomatedQA / SmartBear TestComplete

Pages: 1
IN2ITive
Junior Member


Reged: 05/26/03
Posts: 59
Loc: Canada
Question About Excel and Looping Thru Spreadsheet
      #307114 - 03/06/06 09:17 AM

I am thinking about using an excel spreadsheet that will contain screen names and control names. This sheet would be used for testing of navigation on forms and other things (as I think of them [Smile] )

I was thinking of using something like this:
Column A Column B
Screen Name Control Name
Screen A Textbox A
Screen A Combobox A
Screen A Textbox B
***END*** ***END***
Screen B Textbox A
Screen B Radio button A
***END*** ***END***

I would open the spreadsheet from code and then iterate through column A until I found the screen name that I was looking for. Once found, I would continue until I found the end of the screen's section, which I have designated with ***END***. For this I guess I would check the cell value for that text.

What would be the best approach to:
1. Finding the appropriate section (i.e. Screen A)
2. Stopping once the "***END*** is reached.

The reason I am thinking of this approach is I could pass the screen name/control name into a function and test the navigation on all screens with one function. If new screens/controls are added then just the spreadhseet would have to be modified.


Thanks.


Post Extras: Print Post   Remind Me!   Notify Moderator  
proven
Member


Reged: 09/28/05
Posts: 33
Loc: India
Re: Question About Excel and Looping Thru Spreadsheet
      #307115 - 03/06/06 08:42 PM

Hi IN2ITive,

If I understood you query correctly, you are first looking for the row where your screen name is located then in that particular section of screen name you are navigating till you reach the ..END..

for this you may approach like, first you go on increasing the Row value in spreadsheet by getting the value from each cell in the row and compare that with the name you are looking. Once you find the name then look for the first ..END... in that particular section of screen name.

I presume two dimensional array approach will be easy here.

Give me more thought if the way I understood your post is wrong!

Regards
Proven


Post Extras: Print Post   Remind Me!   Notify Moderator  
KomalRamdeo
Member


Reged: 12/21/05
Posts: 13
Re: Question About Excel and Looping Thru Spreadsheet
      #307116 - 03/07/06 03:16 AM

Hi,

I think What you are doing is in one section you are storing all the controls of that screen then reach till **END*** and then check for the controls of next screen in next section.

If this is the case then why don't you store all the controls of one screen in one row and other screen in other

You just search for the Rows I mean screen name once you have the correct row then iterate through the columns for all the controls till you reach **END*** or just an **EMPTY CELL** in the excel sheet.


Like:

Column A Column B Column C Column D
Screen name col1 col2
Screen A TextBox Combo Box ***END*** (or leave it empty)
Screen B TextBox Combo Box ***END***


This would make your Excel sheet more readable and understandable.
If you leave the last cell empty in the row then you can just iterate till the col count.

Thanks
Komal Joshi


Post Extras: Print Post   Remind Me!   Notify Moderator  
bobbye
Advanced Member


Reged: 05/06/02
Posts: 498
Loc: Las Vegas, NV, USA
Re: Question About Excel and Looping Thru Spreadsheet
      #307117 - 03/07/06 09:21 AM

Hi,

To work with Excel documents from TestComplete script you can use the 'Excel.Application' OLE object. For example, to get the value of a particular cell you can use the following code:
[VBScript]
...
Set xcl = Sys.OleObject("Excel.Application")

// Read data from the first cell
str = xcl.Cells(1,1).Value
...

Therefore, you can create a script that will iterate through rows of a spreadsheet and check its content.

Please let me know if any questions arise.


Post Extras: Print Post   Remind Me!   Notify Moderator  
IN2ITive
Junior Member


Reged: 05/26/03
Posts: 59
Loc: Canada
Re: Question About Excel and Looping Thru Spreadsheet
      #307118 - 03/08/06 05:22 AM

Hi:

Thanks guys for the input. Kamal, I like your suggestion on the layout of the spreadsheet; like you said it would make it more readable and thus easier to add on in the future. Bobbye and proven, thanks for your assistance with looping through the spreadsheet; if I have anymore questions I will let you know.

Thanks again for the help.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 14 anonymous users are browsing this forum.

Moderator:  NickAQA, Robert Martin, martinh, brentpaine 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1366

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5