Hi sandamal,
Whenever I need 'the whole picture' I take a screenshot of the application itself (since you test the app, and Ranorex can handle only instrumented apps).
The only time when taking the screenshot is not possible is when the app is closed. Also, any screenshot of the app doesn't capture any device system pop-up.
Maybe you could give us some details in which situation you cannot use screenshot of the entire app.
Meanwhile, here is a "first try" and resources consuming method, with the following steps:
- use adb command to take screenshot
- use adb command to save screenshot to your PC
- log the screenshot to your report
- clean (delete file from device and PC)
Copy-Paste this code into user code module
*** add 'using System.IO;' reference
Code: Select all
string pathToAdb = "C:\\xxxxxxxx\\Android SDK\\sdk\\platform-tools\\adb.exe"; //your path to adb.exe goes here
//take screenshot
Process adbTakeScreenshot = new Process();
adbTakeScreenshot.StartInfo.FileName = pathToAdb;
adbTakeScreenshot.StartInfo.Arguments = string.Format(" shell screencap /sdcard/Download/myScreenshot.png");
adbTakeScreenshot.Start();
adbTakeScreenshot.WaitForExit();
//save screenshot to PC
Process adbGetScreenshot = new Process();
adbGetScreenshot.StartInfo.FileName = pathToAdb;
adbGetScreenshot.StartInfo.Arguments = string.Format(" pull /sdcard/Download/myScreenshot.png \"C:\\Temp\\screen.bmp\"");
adbGetScreenshot.Start();
adbGetScreenshot.WaitForExit();
//log your screenshot into report Report.LogData(ReportLevel.Info,"Info",Ranorex.Imaging.Load(@"C:\\Temp\\screen.bmp"));
//remove file from USB device
Process adbRemoveFile = new Process();
adbRemoveFile.StartInfo.FileName = pathToAdb;
adbRemoveFile.StartInfo.Arguments = string.Format(" shell rm /sdcard/Download/myScreenshot.png");
adbRemoveFile.Start();
adbRemoveFile.WaitForExit();
//remove file from your PC
System.GC.Collect();
System.GC.WaitForPendingFinalizers();
File.Delete(@"C:\\Temp\\screen.bmp");
Let us know what solution worked for you, even if is one listed here or not.