how to get - Report.Screenshot

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

how to get - Report.Screenshot

Post by omayer » Wed Feb 01, 2012 9:59 pm

I am trying to get screen shot if any window popup , using this code doesn't get the screen captured on report
- Report.Screenshot(repo.PopUp.Self);
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: how to get - Report.Screenshot

Post by Support Team » Thu Feb 02, 2012 3:56 pm

Hi,

Could it be that the RxPath is wrong, because this method should work without any problems?
Do you get an error message, if yes can you send us the report file?
Can you send us the used RxPath and a Snapshot of such a popup window?

Regards,
Markus
Ranorex Support Team

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: how to get - Report.Screenshot

Post by omayer » Tue Feb 07, 2012 5:18 pm

can't get the screenshot on report
WindowForm.zip


public void WindowsPopUp()
{

while (true)
{


if(repo.PopUp.SelfInfo.Exists())
{
Report.Failure("Window Popup");
Report.Screenshot();
Environment.Exit(-1);
}

}}
You do not have the required permissions to view the files attached to this post.
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: how to get - Report.Screenshot

Post by Support Team » Tue Feb 07, 2012 9:16 pm

Could you also post the report/log file that is created, please?
Is there any screenshot in the report?
Have you tried swapping the Report.Failure and Report.Screenshot commands?

Report.Screenshot() without an element argument should create a screenshot of the whole desktop and add it to the report.

Regards,
Alex
Ranorex Team

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: how to get - Report.Screenshot

Post by omayer » Wed Feb 08, 2012 3:41 am

I tried all of these before post -swapping the Report.Failure and Report.Screenshot commands,Report.Screenshot() without an element argument ...report display as blank, whatever i try before this line of code "Environment.Exit(-1);"
gets ignored.
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: how to get - Report.Screenshot

Post by Support Team » Wed Feb 08, 2012 3:36 pm

Hi,

Please answer the questions:
Could you also post the report/log file that is created, please?
Is there any screenshot in the report?
Can you also try to create a new solution which just adds such a screen shots to the report?
Does this properly work?

Regards,
Markus
Ranorex Support Team

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: how to get - Report.Screenshot

Post by omayer » Wed Feb 08, 2012 4:57 pm

ReportScreen.rxlog
ReportScreenCaptur.jpg
You do not have the required permissions to view the files attached to this post.
Tipu

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: how to get - Report.Screenshot

Post by omayer » Wed Feb 08, 2012 5:00 pm

yes it worked in a new solution that create usercode module---here is the code that worked on new solution-

public class MainEntry
{

public void screenCapture()
{

Report.Screenshot();
}



public MainEntry()
{
// Do not delete - a parameterless constructor is required!
}

[STAThread]

public static void Main(string[] args)
{

Report.SetupDefault();

Report.Screenshot();

}


}
}
Tipu

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: how to get - Report.Screenshot

Post by omayer » Wed Feb 08, 2012 5:05 pm

Ok here is the class that work as driver --
----

/*****Check for any popup, click OK and terminate the test*********/
Thread dialogWatchers = new Thread(rmaxValidation.WindowsPopUp);
dialogWatchers.IsBackground = true;
dialogWatchers.Start();

//* Enter Cmsn */////
tempCmsn.ClickNewSplit();

----------------------------
--------rmaxValidation.cs-----------------
public void WindowsPopUp()
{

while (true)
{

if(repo.Explorer_ScriptError.ButtonOKInfo.Exists())
{
Report.Failure("Window Popup");
Report.SetupDefault(); //with this line or w/out same result
Report.Screenshot();
Environment.Exit(-1);
}

}}
Tipu

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: how to get - Report.Screenshot

Post by omayer » Wed Feb 08, 2012 10:30 pm

finally its working by using the following code--

public void WindowsPopUp()
{

while (true)
{

if(repo.Explorer_ScriptError.ButtonOKInfo.Exists())
{

Report.Start();
Report.SetupDefault();
Report.Failure("Windows Popup");
Report.Screenshot();

Environment.Exit(-1);
} :D

}}
Tipu

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: how to get - Report.Screenshot

Post by omayer » Wed Feb 08, 2012 10:46 pm

ok the problem it works intermittent, now after couple of run now i am getting blank result
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: how to get - Report.Screenshot

Post by Support Team » Tue Feb 14, 2012 12:53 pm

Hi,

We are sorry but we cannot reproduce the issue on one of our machines, can you therefore send us your project per mail or can you give us some more information about your test environment and used Ranorex version?

Regards,
Markus
Ranorex Support Team

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: how to get - Report.Screenshot

Post by artur_gadomski » Tue Mar 27, 2012 9:47 am

Isn't it a problem that Reporting from other threads doesn't work?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: how to get - Report.Screenshot

Post by Support Team » Wed Mar 28, 2012 10:12 am

Hi,

I already added it to our internal feature request list.
Please take a look at the following forum entry, it targets the same topic.

Regards,
Markus
Ranorex Support Team