Imacros Browser Not responding with VBScript

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
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
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Imacros Browser Not responding with VBScript

Post by Aditya93 » Sun Jun 23, 2019 3:00 am

Hi,

When I run 1 vbscript at a time, it runs smoothly without any issues, but if i run 2 or more at the same time, one or more of the imacros browser goes not responding. Not sure why that happens


Any suggestion or help would be great :D

Code: Select all

VERSION BUILD=11.5.498.2403
Windows 7 x64 (English)
Imacros Browser V11.5.498.2403
Last edited by Aditya93 on Tue Dec 31, 2019 2:54 pm, edited 2 times in total.
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Imacros Browser Not responding with VBScript

Post by Tom, Tech Support » Mon Jun 24, 2019 10:58 am

Hi Aditya93,

Does this game run normally if you have it open in multiple instances of IE at the same time?

Keep in mind that session state (browser cache) is shared among multiple instances of the iMacros browser, so this could potentially cause problems.

One thing you can try is creating multiple Windows user accounts on your machine, and then run the script once in each user account. This ensures that the sessions are separate and would not interfere with each other.
Regards,

Tom, iMacros Support
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Tue Jun 25, 2019 5:45 am

Hi Tom
Does this game run normally if you have it open in multiple instances of IE at the same time?
Yes, it works properly, even in imacros browser, if it is not initiated by vbscript.
Even 5-7 instances run fine together and can also add 1 which is initiated by vbscript.

But most of the time as soon as i add one more vbscript initiated imacros browser, the first one goes in Not Responding.[which was started by vbscript]

For trying to find where the issue was, I tried few things.
1) started one with vbscript, added another after 1 min, most of the time the first one goes in Not responding.
2) started two at the same time with vbscript, mostly they run fine without going in Not Responding, but sometimes one of them still do.
3) started two, then added 1 more after few mins, the first 2 goes in Not Responding.
All of the above have been initiated by vbscript

I checked the systems Ram and CPU usage, they still have not been fully used, still it goes in Not Responding and only the specific imacros browser goes in Not Responding.
other then that the whole system works smoothly
One thing you can try is creating multiple Windows user accounts on your machine, and then run the script once in each user account. This ensures that the sessions are separate and would not interfere with each other.
I am a bit new to scripting, so i don't have the idea how would I initiate the vbscript from the different user accounts as i can login only one of them at at time.
I think its something related to iimRunner, which i didn't get how to use

one more thing i would like to know, wscript.exe keeps on adding up and r not terminated.
Any way to to terminate them all at once or after the script ends
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Imacros Browser Not responding with VBScript

Post by Tom, Tech Support » Tue Jun 25, 2019 10:55 am

What happens if you try the following:
  1. Start more than one iMacros browser instance manually.
  2. Change your VBScript such that it will attempt to attach to an existing instance of the browser rather than launch a new one, by passing False as the second parameter to iimOpen:

    Code: Select all

    iret = iim1.iimOpen ("", False)
  3. Now run the script multiple times (once for each open browser instance)
Regards,

Tom, iMacros Support
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Tue Jun 25, 2019 11:30 am

Now run the script multiple times (once for each open browser instance)
for example say 3 imacros browsers are open
now i start 3 scripts, so how will it know which needs to run in which of the browser
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Imacros Browser Not responding with VBScript

Post by Tom, Tech Support » Tue Jun 25, 2019 3:36 pm

Aditya93 wrote:
Tue Jun 25, 2019 11:30 am
for example say 3 imacros browsers are open
now i start 3 scripts, so how will it know which needs to run in which of the browser
The iMacros scripting interface will connect to the first browser instance it finds that is not already under the control of the scripting interface.
Regards,

Tom, iMacros Support
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Tue Jun 25, 2019 4:06 pm

It seems to be working without going in Not Responding[went ones in 5-6 trials], but what could be the reason for that?
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Imacros Browser Not responding with VBScript

Post by Tom, Tech Support » Tue Jun 25, 2019 4:34 pm

That is good to hear, and proves what I was suspecting.

The iMacros sidebar is handled differently when launching the iMacros browser manually vs. via script. When launched manually, the sidebar is 'pinnable':

Pinnable Sidebar.png
Pinnable Sidebar.png (24.08 KiB) Viewed 15508 times

But not so when it is launched with the scripting interface:

Static Sidebar.png
Static Sidebar.png (19.53 KiB) Viewed 15508 times

Normally this is not a problem, but for this specific site / application it is causing the issue (for technical reasons that I do not know).

If you do not want to have to launch the browser instances manually, you can still program the script to do this but via the WshShell.Run command rather than with the iMacros scripting interface. For example:

Code: Select all

Const NUM_INSTANCES = 5

set iim1= CreateObject ("imacros")

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")

Dim i
For i = 1 To NUM_INSTANCES
    ' Launch the browser
    WshShell.Run("""C:\Program Files (x86)\Ipswitch\iMacros\iMacros.exe""")
    
    ' Wait a bit before attempting to connect via iMacros SI
    WScript.Sleep(2000)
    iret = iim1.iimOpen ("", False)
    
    ' Wait a bit more before launching the next instance
    If i < NUM_INSTANCES Then
        WScript.Sleep(2000)
    End If
Next
The delays may or may not be necessary, you'll have to test and adjust to see what works best.

For more info on how to use WshShell.Run, see this reference.
Last edited by Tom, Tech Support on Wed Jun 26, 2019 9:47 am, edited 1 time in total.
Reason: Fixed WshShell.Run statement (needed to surround path with double-quotes since it contains spaces)
Regards,

Tom, iMacros Support
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Wed Jun 26, 2019 1:19 am

WshShell.Run("C:\Program Files (x86)\iOpus\iMacros\iMacros.exe")
gives error

Image
http://prntscr.com/o6palb
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Wed Jun 26, 2019 1:43 am

got it to work, needed two extra """ on the end:P
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Imacros Browser Not responding with VBScript

Post by Tom, Tech Support » Wed Jun 26, 2019 9:45 am

Ah yes, sorry about that. I wrote that code on-the-fly without testing it.
Regards,

Tom, iMacros Support
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Thu Jun 27, 2019 9:36 am

Hi

Still the issue of Not Responding is persisting.
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Sun Jun 30, 2019 12:59 am

Any way I could kill the Not Responding tasks with the task scheduler?

tried this in .bat
taskkill /f /im wScript.exe

it works

but when i try
taskkill /f /im imacros.exe

it doesnt work, not sure why
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Sun Jun 30, 2019 2:46 am

not sure wht the issue was, it seems to be working now
Aditya93
Posts: 55
Joined: Sat Nov 25, 2017 5:34 am

Re: Imacros Browser Not responding with VBScript

Post by Aditya93 » Sat Jul 06, 2019 3:38 pm

any way to use .bat to open the files in the browser that is already opened a specific one among them
Post Reply