[ ] STRING sSFileName="FileName"
[ ] STRING sTFileName="FileNameTarget"
[ ]
[-] window DialogBox DS
[ ] tag "{sSFileName} - Microsoft Word"
[ ]
[-] window DialogBox D1
[ ] tag "Document1 - Microsoft Word"
[ ]
[-] window DialogBox SaveAs
[ ] tag "Save As"
[ ] parent DS
[ ]
[-] window DialogBox Open
[ ] tag "Open"
[ ] parent D1
[ ]
[-] testcase Copy_Content_Of_Word_To_Notepad()
[ ] SYS_Execute("Start Winword.exe")
[ ] D1.SetActive()
[ ]
[ ] D1.TypeKeys("
[ ] Open.TypeKeys("
[ ] Open.TypeKeys("
[ ] Open.TypeKeys("
[ ] DS.SetActive()
[ ]
[ ] DS.TypeKeys("
[ ] SaveAs.TypeKeys("
[ ] SaveAs.TypeKeys("
[ ] SaveAs.TypeKeys("
[ ]
[ ] DS.DialogBox("Microsoft Word|$MessageBox").TypeKeys("
[ ] DS.DialogBox("File Conversion - {sSFileName}").TypeKeys("
[ ] DS.DialogBox("File Conversion - {sSFileName}").TypeKeys("
[ ] DS.TypeKeys("
[ ]
The 4test code will make an .txt file and you can read the content of this file and verify your data.
3 comments:
You can also, open the document, desktop type keys 'Ctrl-A' on the document and 'Ctrl-C' to the clipboard. Then using SilkTest clipboard functions, work with the data (put it in a list, etc). Good for one time data usage.
Have you had an experience working with Microsoft word documents? I need to test the content of a Word plugin/app that we use - I guess writing a utility (VB, C#, etc.) to do this is one way. Do you know of any other 'easier' way? The test requires capturing all components of the document (text, chart, table, excel objects) - and changing all components.
How about VBA?
Post a Comment