Can I control Ranorex.Controls.ProgressForm?

Class library usage, coding and language questions.
User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Can I control Ranorex.Controls.ProgressForm?

Post by Ciege » Fri Jun 17, 2011 4:06 pm

Is it possible to send my own text to Ranorex.Controls.ProgressForm?

Generally I do not use it, but I do have a case where I am doing a lot of "unseen" calculations and comparisons in my automation code. It would look to anyone watching that the system is doing nothing.

Rather than create my own dialog and populate with the information then dispose of the dialog, I would like to Show() the ProgressForm, update it with information as to what is going on in the test, then Hide() the ProgressForm when the long test is complete. Thus providing the user with feedback that indeed, something is happening.

Currently, when I Show() the form the only thing that is listed is "User Code" which is not very descriptive.
ProgressForm.jpg
ProgressForm.jpg (6.29 KiB) Viewed 1331 times
Thanks...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Can I control Ranorex.Controls.ProgressForm?

Post by sdaly » Fri Jun 17, 2011 4:41 pm

I got this snippet from Michael a while back....basically you need to set up a "TestReport" for it to output information. After doing so, every Report statement will output in the wee form. The second bit is only needed if you want to customise the name of the test displayed etc.

Code: Select all

TestReport.Setup(ReportLevel.None, "tempTestReport.rxlog", false);
			TestReport.EnableTracingScreenshots = false;
			TestReport.ReportWriteInterval = 0;
			Ranorex.Controls.ProgressForm.Show();

			//Shows Test Suite name and running test name in progress form
			using (new ActivityContext(new TestSuiteActivity("Automation", "", 0, null, "", "")))
			{
				using (new ActivityContext(new TestCaseActivity("Test", "", "", "", 0, 0, null, "", null)))
				{
				}
			}

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Can I control Ranorex.Controls.ProgressForm?

Post by Ciege » Fri Jun 17, 2011 4:46 pm

Hmmm, I do already set up a test report (although I set it to an XML file instead of an RXLOG file) and none of my Report.XXX statements make it into the ProgressForm...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Can I control Ranorex.Controls.ProgressForm?

Post by sdaly » Fri Jun 17, 2011 4:55 pm

You sure it's TestReport and not Report that you use?!

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Can I control Ranorex.Controls.ProgressForm?

Post by Ciege » Fri Jun 17, 2011 4:58 pm

Ahh! well look at that... You are correct... So much for my reading and comprehension skills... :oops:

So what's the difference with a Report and TestReport?
Since I only want to use the ProgressForm in a small area of code that takes a long time to run, I suppose I would have no issues generating the TestReport there then disposing it when I am done?

Thanks for the pointer... I'll start looking into it.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Can I control Ranorex.Controls.ProgressForm?

Post by sdaly » Fri Jun 17, 2011 5:03 pm

They both look slightly different! Apart from that I'm not too sure tbh, maybe the Ranorex team can shed some light on this?

That bit of code is the code that I use as we already had a style sheet set up for the old report and didn't want to have to mess around with it. We still use the Report.Setup but you'll notice in the TestReport.Setup the logging level is set to none and the report name is the same so just gets overwritten each time.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Can I control Ranorex.Controls.ProgressForm?

Post by Ciege » Fri Jun 17, 2011 5:35 pm

Thanks again for the info... Got it working, mostly.
Do you get this exception when hiding the ProgressForm or do you even Hide the form?

http://www.ranorex.com/forum/exception- ... t2319.html
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Can I control Ranorex.Controls.ProgressForm?

Post by sdaly » Fri Jun 17, 2011 6:27 pm

I've never had the need to hide it...it jumps around automatically if it's going to obstruct anything you are working with!

As a temp workaround for that issue you could set Control.CheckForIllegalCrossThreadCalls = false.