Hello,
I'm doing research to the possibilities of Ranorex to test Word 2013 add-ins. These add-ins can create for instance templates. The problem I have is that when I want to verify text in a new opened template with document name: Document2 that I can't select specific text in de document. I can only add the whole page to my repository with all the text with the object spy. Does anybody knows how to add a specific line of text in the word document to my repositroy?
Thanks in advance.
Object spy Word 2013 text
Re: Object spy Word 2013 text
There are several forum posts asking similar questions, please search the forum before posting as you might find the answer.
For example: http://www.ranorex.com/forum/automation ... t6550.html
For example: http://www.ranorex.com/forum/automation ... t6550.html
Shortcuts usually aren't...
-
- Posts: 4
- Joined: Mon May 18, 2015 8:20 am
Re: Object spy Word 2013 text
I have tried serveral thing with the raw text for instance but I can't add specific lines of text to my repository. I've also added the Mircrosoft.Office.Interop.Word reference and use this:
var document1 = repo.Document1Word.Document1;
var wordDocObj = document1.GetWordDocumentObject();
var words = wordDocObj.Words;
foreach(Word.Range word in words)
{
Report.Info(word.Text);
}
It reports all the words that are in my word document but how can I validate these words or add then to my repository?
var document1 = repo.Document1Word.Document1;
var wordDocObj = document1.GetWordDocumentObject();
var words = wordDocObj.Words;
foreach(Word.Range word in words)
{
Report.Info(word.Text);
}
It reports all the words that are in my word document but how can I validate these words or add then to my repository?
Re: Object spy Word 2013 text
I'm not sure what you mean by "add them to my repository". Could you explain what you mean by that? What are you trying to accomplish?
As for validation, you will need to do some string manipulation to pull out each word individually and validate that it is correct based on what you expect. That will require user-code most likely.
As for validation, you will need to do some string manipulation to pull out each word individually and validate that it is correct based on what you expect. That will require user-code most likely.
Shortcuts usually aren't...