Posts: 21
Threads: 7
Joined: Feb 2011
Reputation:
0
02-13-2011, 10:35 AM
(This post was last modified: 02-14-2011, 03:24 AM by priya999.)
hi i am trying to close all opened internet explorer using task manager
i have used for loop to close all the error by getting the number of ie opened
but its only perform this operation for oneiteration and from 2nd itearation it throws the folln error
"not found "
Posts: 128
Threads: 9
Joined: Oct 2009
Reputation:
0
02-16-2011, 01:19 AM
I can see a few issues here and some common mistakes. Without seeing your code its hard to say exactly. Common mistakes are to not start with "0" in the loop. Vbscript arrays are zero based. Maybe all the processes ended, but you are still trying to process one. use "On error goto 0" to override VBscripts stop on line with error and then handle the event manually.
If nothing works, post more of your code.
Hope this helps.
Posts: 21
Threads: 7
Joined: Feb 2011
Reputation:
0
02-22-2011, 08:51 AM
thank u i will try again and will post the code here
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
02-23-2011, 10:05 PM
Why are you looping through task manager? Any specific purpose?
If my req is simply to close all open IE then i would use
Systemutil.closeprocessbyname "iexplore.exe"
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 21
Threads: 7
Joined: Feb 2011
Reputation:
0
02-25-2011, 08:00 AM
(This post was last modified: 02-25-2011, 08:07 AM by priya999.)
ha ha that was simple solution
from now i will try to keep my scirpt simple
but i have doudt that
when i trying to close the ie process from the task manager
first issue
i can see that there are 2 process for each ie opened
second issue
no matter how many ie are opened qtp closes them all in first iteration
thats is the reason for the second loop it gives "not found" error
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
02-25-2011, 03:35 PM
2 Process for each IE - Restart the machine and try again. It never happens that way.
no matter how many ie are opened qtp closes them all in first iteration
thats is the reason for the second loop it gives "not found" error - Restart should resolve the issue if you are using the right code. However, would you mind pasting the code?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.