Hello,
For my mobile automation i need to save the screenshot alone. As mentioned in the below post,
1) is it possible to save the screenshot alone in a particular folder?
2) If not is it possible to customize the location of the report screenshot folder?
https://www.ranorex.info/taking-screens ... ml#p28263/
Change report screenshot location
Re: Change report screenshot location
Hi theraviz,
It isn't currently possible to configure the folder in which image-based artefacts are stored in Ranorex Studio using the built-in Screenshot feature. It is possible to take a screenshot using Report.Screenshot() in a code module and then (also in code), move that image to another directory, but there is nothing built-in to Ranorex with this capability in mind at this time.
--Jacob
It isn't currently possible to configure the folder in which image-based artefacts are stored in Ranorex Studio using the built-in Screenshot feature. It is possible to take a screenshot using Report.Screenshot() in a code module and then (also in code), move that image to another directory, but there is nothing built-in to Ranorex with this capability in mind at this time.
--Jacob
Re: Change report screenshot location
Thanks Jacob but would be helpful if anyone can provide a sample code for the same. Thanks in advance..
Re: Change report screenshot location
Hi,
There is plenty of sample codes available in this forum. Check for example this post:
https://www.ranorex.info/viewtopic.php? ... 103#p34103
There is plenty of sample codes available in this forum. Check for example this post:
https://www.ranorex.info/viewtopic.php? ... 103#p34103
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Change report screenshot location
Hi Pavel,
Thanks for your reply and sorry to bother you again. I tried the code provided in the post and some other codes in the forum too. But I could'nt find a way to pass RanorexRepository Item as element to capture.
When I pass the repository item as argument, it says "Cannot Convert from RepositoryItemInfo to Ranorex.Core.Element.
Kindly let me know how to pass a repository item as argument (Element) to the code below.
//Take a screenshot of a specific element
Bitmap image = Imaging.CaptureImageAuto(element.Element);
Thanks in advance
Thanks for your reply and sorry to bother you again. I tried the code provided in the post and some other codes in the forum too. But I could'nt find a way to pass RanorexRepository Item as element to capture.
When I pass the repository item as argument, it says "Cannot Convert from RepositoryItemInfo to Ranorex.Core.Element.
Kindly let me know how to pass a repository item as argument (Element) to the code below.
//Take a screenshot of a specific element
Bitmap image = Imaging.CaptureImageAuto(element.Element);
Thanks in advance
Re: Change report screenshot location
I tried using Adapter instead of RepoItem and this time the previous error is gone but now I am getting "A generic error occured in GDI+"
Re: Change report screenshot location
Hi,
You must create or find an adapter of the repoiteminfo element passed to the method. Try something like this...Ideally, replace 'Unknown' with appropriate element type. Hope this helps?
You must create or find an adapter of the repoiteminfo element passed to the method. Try something like this...
Code: Select all
public void UserCodeMethod(RepoItemInfo repoElement)
{
Bitmap image = Imaging.CaptureImageAuto(repoElement.CreateAdapter<Ranorex.Unknown>(false).Element);
}
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Change report screenshot location
Hi Pavel,
Tried using adapters but it am getting 'A generic error occurred in GDI+ error.
This error is at the line where it tries to save the file. I could see the screenshot in the report but cant save the file due to this error.
Tried using adapters but it am getting 'A generic error occurred in GDI+ error.
This error is at the line where it tries to save the file. I could see the screenshot in the report but cant save the file due to this error.
Re: Change report screenshot location
I'm afraid, I can't help you with that? For me it works. So it appears to be some kind of system-related issue? Please search the internet for this error and possible solutions.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Change report screenshot location
Thanks Pavel for the supports