Screenshot file permissions

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Screenshot file permissions

by kreiter on Mon May 21, 2018 10:37 am

Windows Server 2012R2
iMacros Browser (x86) Version 11.5.498.2403

When I run my macros iim files via PHP in the iMacros browser, everything works with screenshots. When I try running the macros via Chrome, Firefox or IE, the screenshots fail. I am using the iMacros runas agent (-runner).

I get an error:
Cannot copy the item being saved to destination file: C:\xxx\xxx\xxx.png (removed for security) The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)). Line 6: TAG POS=1 TYPE=TD FORM=NAME:frmGIMD ATTR=TXT:TrackRecordName:* CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT (-1000)

Here is the code being run
php:
$s = $iim1->iimSet("FilePath", $screenshot_test_folder);
$s = $iim1->iimSet("FileName", $FileName);
mkdir($screenshot_test_folder, 0777, true);
$s = $iim1->iimPlay("Take_Screenshot");
iim:
SET !ERRORIGNORE YES
ONDOWNLOAD FOLDER={{FilePath}} FILE={{FileName}}
WAIT SECONDS=2
FRAME NAME=content
TAG POS=1 TYPE=TD FORM=NAME:frmXXXX ATTR=TXT:Key<SP>Team* CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT

I am certain the folder exists and that permission are set to "everyone modify". I am sure it's some little thing I'm not setting but I have googled for hours and spent way too much time on this. There is a quirk with the iMacros browser in a particular site that causes me to need to use a different browser but then other stuff is broken when in the other browsers.
kreiter
 
Posts: 3
Joined: Mon May 21, 2018 10:23 am

Re: Screenshot file permissions

by chivracq on Mon May 21, 2018 2:03 pm

kreiter wrote:
Code: Select all
Windows Server 2012R2
iMacros Browser (x86) Version 11.5.498.2403


When I run my macros iim files via PHP in the iMacros browser, everything works with screenshots. When I try running the macros via Chrome, Firefox or IE, the screenshots fail. I am using the iMacros runas agent (-runner).

I get an error:
Code: Select all
Cannot copy the item being saved to destination file: C:\xxx\xxx\xxx.png (removed for security) The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)). Line 6: TAG POS=1 TYPE=TD FORM=NAME:frmGIMD ATTR=TXT:TrackRecordName:* CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT (-1000)


Here is the code being run
php:
Code: Select all
   $s = $iim1->iimSet("FilePath", $screenshot_test_folder);
   $s = $iim1->iimSet("FileName", $FileName);
   mkdir($screenshot_test_folder, 0777, true);
   $s = $iim1->iimPlay("Take_Screenshot");

iim:
Code: Select all
   SET !ERRORIGNORE YES
   ONDOWNLOAD FOLDER={{FilePath}} FILE={{FileName}}
   WAIT SECONDS=2
   FRAME NAME=content
   TAG POS=1 TYPE=TD FORM=NAME:frmXXXX ATTR=TXT:Key<SP>Team* CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT


I am certain the folder exists and that permission are set to "everyone modify". I am sure it's some little thing I'm not setting but I have googled for hours and spent way too much time on this. There is a quirk with the iMacros browser in a particular site that causes me to need to use a different browser but then other stuff is broken when in the other browsers.

Ouf-ouf...!, I'm a bit "puzzled" like you, to be honest... :oops:
And I don't use iMB nor the Scripting Interface so I never had a "Chance" to play around with all that Functionality you are using...

But OK, my 2cts for "Things" you can try, (or that I would try), to troubleshoot/isolate/identify the Pb...

The 'RPC' RuntimeError you posted belongs to IE, I would think, and ErrorCode "-1000" is indeed iMB/IE, I "normally" don't use (iMacros for) IE (only FF), but I finally installed iMacros for IE (v12.0, on IE11, Win10_x64) recently for some other Thread on the Forum, and I encountered quite a lot of those 'RPC' RuntimeErrors while doing nothing "special", just running a very simplistic ('.iim') Macro, you don't mention your FCI related to the 3 IE+FF+CR Browsers, but doing your "Tests" on FF (=> FF55/56 + iMacros for FF v8.9.7 (and not v9.0.3)) might be more "reliable"...
And CR would be my last Choice anyway..., but hum..., unless you have the 'PE' Version ('Personal Edition') if using v10.0.1 for CR, (which I guess is very probably not the case as if your iMB v11.5 License was still valid, you would have probably already updated to v12.0), your Script won't work on CR anyway as you need the FIO Functionality for the 'SAVE_xxx' to work.
[FIO = File I/O = File Access]

You would first need to check with "pure" '.iim' Macros that your Script works correctly in all 3 Browsers... (=> Need to hard-code the Path and Filename...)
+ Check with the Default iMacros 'Downloads' Folder.
+ Check with 'SAVEITEM' (both as Standalone Command + as 'TAG EVENT'), and with 'SAVETARGETAS' (as 'TAG EVENT').
Not visible from your Script what for Values you have for 'FilePath' and 'FileName', but Spaces and Backslashes could play a role, so try to avoid them first, and try to specify a FileName with a '.png' Extension...

Oh ja, stg else..., your 'mkdir' from '.php' is maybe not needed I would think, and/or is a bit "Double" maybe, and could create a Lock on that from '.php' created Folder, not sure btw what happens if you try to create a Folder that already exists..., but the 'FOLDER' Parameter from the 'ONDOWNLOAD' Command is able as well to create the Folder if it doesn't exist...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Screenshot file permissions

by chivracq on Mon May 21, 2018 2:26 pm

@OP, I see you are checking my Post, I made a few Edits..., refresh the Page, ah-ah...! :wink:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Screenshot file permissions

by kreiter on Mon May 21, 2018 2:34 pm

Lots of information there and I will take some time to digest it. The mkdir in php was me testing to see if iM was failing to create the folder. We use enterprise so shouldn't be a limitation there. I have upgraded to v12 to see if that helps and it didn't. The error from iM states where it is trying to save the file so I know it's trying to put it in the right place. There won't be a collision of an existing folder because each process creates a new parent folder.

I am trying to get ie, ff or cr to work because I have a site I am trying to post data to that throws errors when using the iMB. Basically if the php fails it leaves the site in a "logged in' state and wont let me log into a different account because it knows I'm still logged in to another account. It's tracked at the server side via IP so I can't control it. IE, FF and CR all show an error page allowing me to log out correctly which I can script if it happens but once I get the error in iMB there is nothing I can do for some reason. I assume some little bug in iMB that I have no way to chase down.

The site has a popup that eliminates me using CR because it doesn't support ONDIALOG. I had a different issue with support on FF so I am left hoping IE will work but the final (and very important step) is to take a screenshot and save it.
kreiter
 
Posts: 3
Joined: Mon May 21, 2018 10:23 am

Re: Screenshot file permissions

by kreiter on Mon May 21, 2018 2:40 pm

FYI: Chrome always says "File Access Not Installed" no matter what I do.
kreiter
 
Posts: 3
Joined: Mon May 21, 2018 10:23 am


Return to Command Line and Scripting Interface

Who is online

Users browsing this forum: No registered users and 5 guests

-->