You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.
What steps will reproduce the problem?
Screenshot myScreenShot = ((ITakesScreenshot)driver).GetScreenshot();
string saveMe = saveLocation + "\\" + dtForFileName + ".jpg";
mybit.SaveAsFile(saveMe, ImageFormat.Jpeg);
The exception is thrown on SaveAsFile.
I have read solutions about not disposing the stream until after the save but I am
not creating my own stream, the SaveAsFile() function does that as shown below:
using (MemoryStream imageStream = new MemoryStream(this.byteArray))
{
Image screenshotImage = Image.FromStream(imageStream);
screenshotImage.Save(filename, format);
}
Selenium version: 2.24
OS: Windows 7
Browser: IE9
Browser version: 9.0.8112.16421
Reported by briandavid7324 on 2012-09-11 16:36:26
The text was updated successfully, but these errors were encountered:
Hi!
is this issue still reproducible? Please recheck it at latest Selenium version, please.
If the issue is still occured please provide full exception ifno, your test code and
html+css+js or pulic URL at which error is happened.
This issue should be close, it's on the System.drawing library issue.
Just to help in saving your screenshot. Use binary writer. 100% working
var screenshot = ((ITakesScreenshot)webDriver).GetScreenshot();
byte[] imageBytes = Convert.FromBase64String(screenshot.ToString());
using (BinaryWriter bw = new BinaryWriter(new FileStream(fileName, FileMode.Append,
FileAccess.Write)))
{
bw.Write(imageBytes);
bw.Close();
}
Originally reported on Google Code with ID 4537
Reported by
briandavid7324
on 2012-09-11 16:36:26The text was updated successfully, but these errors were encountered: