Forum Discussion

walticausch's avatar
14 years ago

Reading out a Excel cell via GUI Record a test and create a Check point

I am evaluating this Testool and i need a simple Record/Replay/Verify Tool.

I came across the following problem and after looking through the Helps&FAQs i did not find in time a solution, so i will ask here as my time of evaluation is short.



How can i read out , as a checkpoint an (calculated) Excel cell just by using the GUI tools and not by scripting



The testcase/recording is quite simple:



Start Excel with an empty workbook

Put "1" into A1

Put "2" into B1

Put "=SUM(A1:B1) into C1



This equals to "3" in C1



Now i start the Checkwizard.....

select "Check object contents or properties" > Next

select "Check object property" > next

Now i drag the Pointer over the workbook, "the whole workbook" gets framed in red and itentifys itsself as

object "Aliases.EXCEL.wndXLMAIN.XLDESK.wndMappe1" >next.

Now the "select property" window shows up and i cannot find anyway here to find the "calculated" 3 of cell C1



Could somebody enlighten me, what i am doing wrong !



Thanks for a quick

help

Walti

1 Reply

  • Hi Walter,



    Excel doesn't expose GUI objects for individual cells inside the workbooks — you'll need to use Excel Automation API (the Excel.Application scripting object) to access their data.



    For example, to get the "calculated" text of the C1 cell in an active workbook and sheet, you can use the following expression:

    Sys.OleObject("Excel.Application").ActiveWorkbook.ActiveSheet.Range("C1").Text



    I'm afraid, you can't select scripting objects in the checkpoint wizard, so you need to add such a checkpoint to your test manually. In VBScript, for example, the checkpoint for the C1 cell would look like this: