Class library usage, coding and language questions.
- Posts: 3
- Joined: Fri Jul 27, 2012 7:25 am
The software that I'm testing has a log window with a text field (System.Windows.Forms.RichTextBox) and I want to extract it and save it together with the test report.
When I use the following code, it only adds 4k of text, not the entire text field.
TextWriter tw = File.CreateText( pathToLogFile );
tw.Write( repo.MachineConfigurator.LoggingOutput.Text.SelectionText );
How can I get the remaining part of the text?
- Ranorex Guru
- Posts: 5068
- Joined: Mon Aug 13, 2012 9:54 am
- Location: Zilina, Slovakia
My guess is that the text is not entirely visible (lazy loaded) in the RichTextBox and this is why you are not getting the whole text. I think your only hope is to scroll the text in the RichTextBox (using PageDown or just Down key) and read and merge each loaded page with the previous one. Do it in a loop using the RichTextBox scroll bar max/page value (if available). This should help you with "loading" entire text.
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration