No Screenshots with SAVEAS

Discussions and Tech Support related to using the iMacros Component for .NET in your applications.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
UnicornWrangler
Posts: 5
Joined: Sat Jul 13, 2013 6:54 pm

No Screenshots with SAVEAS

Post by UnicornWrangler » Sun Jul 14, 2013 6:44 am

Greetings:

I am converting vb.net project from the scripting interface (V7.31.1339) to the .NET component. My project navigates a document management system which is password-protected and behind a pay wall.

To find out how much a given sequence of documents would cost to download, the project navigates to each the document, extracts the cost information, and takes a screenshot of the server's response to the document request. This works fine in the scripting interface, but I have not yet saved a screenshot with the .NET component.

This code works with the scripting interface . . .

Code: Select all

iim1.iimSet("BaseFileName", Trim(BaseFileName))
iim1.iimPlay("CODE: SAVEAS TYPE=PNG FOLDER=" & My.Settings.iMacrosDownloadPath & " FILE={{BaseFileName}}.png")
I placed these five lines of code in my .NET project . . .

Code: Select all

iim.Play("CODE: SAVEAS TYPE=MHT FOLDER=C:\Unicorn\Output FILE=PacerPage" & vbCrLf & "WAIT SECONDS=1")

iim.Play("CODE: SAVEAS TYPE=JPEG FOLDER=C:\Unicorn\Output FILE=PacerPage" & vbCrLf & "WAIT SECONDS=1")
iim.Play("CODE: SAVEAS TYPE=PNG FOLDER=C:\Unicorn\Output FILE=PacerPage" & vbCrLf & "WAIT SECONDS=1")
iim.Play("CODE: SAVEAS TYPE=BMP FOLDER=C:\Unicorn\Output FILE=PacerPage" & vbCrLf & "WAIT SECONDS=1")

iim.Play("CODE: SAVEAS TYPE=TXT FOLDER=C:\Unicorn\Output FILE=PacerPage" & vbCrLf & "WAIT SECONDS=1")
SAVEAS MHT and TXT both work, but for me BMP JPEG and PNG do not.

I am using SAVEAS MHT in my project and it works just fine and that makes me happy but I'd sleep better if I knew how to get a screenshot instead.
Last edited by UnicornWrangler on Wed Feb 19, 2014 11:50 pm, edited 1 time in total.
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: No Screenshots with SAVEAS

Post by Tom, Tech Support » Mon Jul 15, 2013 12:27 pm

Hi UnicornWrangler,

Are you checking the return value after you call iimPlay for attempting to save a screenshot? Is it returning success or failure, and what's the value?

I just tested it with the TakeScreenshot.iim demo macro that installs with iMacros and did not have any problem.

Please be aware that TYPE=JPEG is only supported in iMacros for Firefox.
Regards,

Tom, iMacros Support
UnicornWrangler
Posts: 5
Joined: Sat Jul 13, 2013 6:54 pm

Re: No Screenshots with SAVEAS

Post by UnicornWrangler » Tue Jul 16, 2013 2:16 am

Tom:

I get the following error information:

Error Code: -1000

Error Text: Operation is not valid due to the current state of the object.

Image

UnicornWrangler
Last edited by UnicornWrangler on Sun Aug 04, 2013 9:52 pm, edited 1 time in total.
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: No Screenshots with SAVEAS

Post by Tom, Tech Support » Tue Jul 16, 2013 11:08 am

Please try the following test:

Run the TestComponent application (either VB or C# version) that installs with the iMacros Component for .NET, click the Play button and select the TakeScreenshot.iim demo macro that installs with iMacros. Let me know if this works.
Regards,

Tom, iMacros Support
UnicornWrangler
Posts: 5
Joined: Sat Jul 13, 2013 6:54 pm

Re: No Screenshots with SAVEAS

Post by UnicornWrangler » Wed Jul 17, 2013 1:11 am

Tom:

I did as directed, and it worked, so I think there must be something wrong with some aspect of my project, which isn't your problem.

If I find out why I can't make screenshots I'll post.

Thanks for your help.

Unicorn Wrangler
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: No Screenshots with SAVEAS

Post by Tom, Tech Support » Wed Jul 17, 2013 8:46 am

Thanks for checking, and please do update this post with your findings! I'm sure it will help other users in the future.
Regards,

Tom, iMacros Support
UnicornWrangler
Posts: 5
Joined: Sat Jul 13, 2013 6:54 pm

Re: No Screenshots with SAVEAS

Post by UnicornWrangler » Sun Aug 04, 2013 9:07 pm

Tom:

I am happy to report that I can now take screenshots with the component.

The Issue:

Screenshots fail in .NET 4.0 and 4.5

How The Issue Happened :

I use Visual Studio 2012 which by default targets the 4.5 Framework.

How The Issue Was Resolved:

I started a new project with the 3.5 Framework and transferred the code block by block.

To prove it to yourself . . .

Open the test component project.

Change the target Framework from 3.5 to 4.0 or 4.5.

When you run the TakeScreenshot.iim macro it will fail with the errors reported above and shown below:

Image


UnicornWrangler
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: No Screenshots with SAVEAS

Post by Tom, Tech Support » Mon Aug 05, 2013 3:48 pm

Hi UnicornWrangler,

Thanks for the update! This problem will be made irrelevant in a couple of weeks after we release a .NET 4 version of the component.
Regards,

Tom, iMacros Support
UnicornWrangler
Posts: 5
Joined: Sat Jul 13, 2013 6:54 pm

Re: No Screenshots with SAVEAS

Post by UnicornWrangler » Thu Feb 20, 2014 3:42 am

And the end of the story . . .

Just so you know, the .NET 4.0 component is available and does take screenshots.

UnicornWrangler
fastRSgold
Posts: 4
Joined: Tue Nov 25, 2014 6:10 am

Re: No Screenshots with SAVEAS

Post by fastRSgold » Tue Nov 25, 2014 6:16 am

It can be changing into any lotto business, if you do not function 14 hours each day, a week per week and look game playing for several years."According to Taylor, your

"heyday" of gamemaking has passed."There would be a prime in the 1990s where you could break open in the door of your author and you can have a contract,Inch Taylor stated. "You

blew your financial allowance anyway, and they dealt with this. Containing secured themselves thus restricted. Units are going to just strike the actual wall membrane.
https://www.mmo7d.com/
https://www.fastfifa15.co.uk/
Post Reply