Best way to take screenshots of tests in Selenium 2?

To do screenshots in Selenium 2 you need to do the following driver = new FireFoxDriver(); // Should work in other Browser Drivers driver.Navigate().GoToUrl(“http://www.theautomatedtester.co.uk”); Screenshot ss = ((ITakesScreenshot) driver).GetScreenshot(); //Use it as you want now string screenshot = ss.AsBase64EncodedString; byte[] screenshotAsByteArray = ss.AsByteArray; ss.SaveAsFile(“filename”, ImageFormat.Png); //use any of the built in image formating ss.ToString();//same as … Read more

How to record screen and take screenshots, using Android API?

First step and the one which Ken White rightly suggested & which you may have already covered is the Example Code provided officially. I have used their API earlier. I agree screenshot is pretty straight forward. But, screen recording is also under similar lines. I will answer your questions in 3 sections and will wrap … Read more

How to take a screenshot of a current Activity and then share it?

This is how I captured the screen and shared it. First, get root view from current activity: View rootView = getWindow().getDecorView().findViewById(android.R.id.content); Second, capture the root view: public static Bitmap getScreenShot(View view) { View screenView = view.getRootView(); screenView.setDrawingCacheEnabled(true); Bitmap bitmap = Bitmap.createBitmap(screenView.getDrawingCache()); screenView.setDrawingCacheEnabled(false); return bitmap; } Third, store the Bitmap into the SDCard: public static void … Read more

Get a screenshot of a specific application

The PrintWindow win32 api will capture a window bitmap even if the window is covered by other windows or if it is off screen: [DllImport(“user32.dll”)] public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); [DllImport(“user32.dll”)] public static extern bool PrintWindow(IntPtr hWnd, IntPtr hdcBlt, int nFlags); public static Bitmap PrintWindow(IntPtr hwnd) { RECT rc; GetWindowRect(hwnd, out … Read more

How to screen shot a UAC prompt?

This method using the group policy editor should do the job: 1) Run gpedit.msc 2) Under Computer Configuration\Windows Settings\Security Settings\Local Policies\SecurityOptions: Change “User Account Control: Switch to the secure desktop when prompting for elevation” to disabled Undo this change after the screenshot, because it makes the system less secure!

How can I take a screenshot in a windows application?

HDC hScreenDC = GetDC(nullptr); // CreateDC(“DISPLAY”,nullptr,nullptr,nullptr); HDC hMemoryDC = CreateCompatibleDC(hScreenDC); int width = GetDeviceCaps(hScreenDC,HORZRES); int height = GetDeviceCaps(hScreenDC,VERTRES); HBITMAP hBitmap = CreateCompatibleBitmap(hScreenDC,width,height); HBITMAP hOldBitmap = static_cast<HBITMAP>(SelectObject(hMemoryDC,hBitmap)); BitBlt(hMemoryDC,0,0,width,height,hScreenDC,0,0,SRCCOPY); hBitmap = static_cast<HBITMAP>(SelectObject(hMemoryDC,hOldBitmap)); DeleteDC(hMemoryDC); DeleteDC(hScreenDC);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)