 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
|
|
Ok. Now it makes more sense. The job is running, but it is either not detecting the appearance of the required Internet Explorer window or not starting the macro.
Let' assume for a moment it is not detecting the window. To verify that, let's add 2 extra lines to the job script to make it write to the job log its progress of work. After "Wait 10" line insert another line with the following text
LogAddMessageEx("INFO", @V"job_id", "@V"job_name"", "Waiting 10 seconds before next check")
After "Found:" line insert
LogAddMessageEx("INFO", @V"job_id", "@V"job_name"", "Found MoMA window.")
|
|
Mon Jun 16, 2008 2:12 pm |
|
 |
Vitae1313
Joined: 05 Jun 2008 Posts: 11 Country: United States |
|
|
|
OK, all of a sudden it's detecting the page, BUT then it doesn't stop and continues in a loop of running the macro every 10 seconds. Disabling the job wouldn't even stop it. Had to shut the scheduler down to get it to stop.
6/16/2008 15:24:28.906000 0 2 0 Web Page Trigger Waiting 10 seconds before next check
6/16/2008 15:24:38.937000 0 2 0 Web Page Trigger Waiting 10 seconds before next check
6/16/2008 15:24:48.968000 0 2 0 Web Page Trigger Waiting 10 seconds before next check
6/16/2008 15:24:49.000000 0 2 0 Web Page Trigger Found MoMA window.
6/16/2008 15:24:59.187000 0 2 0 Web Page Trigger Waiting 10 seconds before next check
6/16/2008 15:24:59.218000 0 2 0 Web Page Trigger Found MoMA window.
6/16/2008 15:25:09.343000 0 2 0 Web Page Trigger Waiting 10 seconds before next check
6/16/2008 15:25:09.375000 0 2 0 Web Page Trigger Found MoMA window.
6/16/2008 15:25:19.500000 0 2 0 Web Page Trigger Waiting 10 seconds before next check
6/16/2008 15:25:19.531000 0 2 0 Web Page Trigger Found MoMA window.
6/16/2008 15:25:29.718000 0 2 0 Web Page Trigger Waiting 10 seconds before next check
6/16/2008 15:25:29.750000 0 2 0 Web Page Trigger Found MoMA window.
6/16/2008 15:25:35.875000 1 0 0 24x7 Scheduler 1 spawned process is still running. Shutting down the scheduler now may cause unpredictable results.
6/16/2008 15:25:35.875000 0 2 0 Web Page Trigger Waiting 10 seconds before next check
6/16/2008 15:25:35.921000 0 0 0 24x7 Scheduler 24x7 Scheduler terminating...
I'm thinking that it might be because there IS more to the title than what i was giving previously.
The actual title of the screen is:
MoMA - Proprietary Info that I couldn't disclose - Windows Internet Explorer
I don't know what it wasn't working before, but it is now if all that was added was the extra log info. But from what I see in the log, it looks like it's stopping at MOMA and not continuing on because of the - that is between them?
How do i tell scheduler that the - after MoMA is actually something that is needed?
|
|
Mon Jun 16, 2008 3:29 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
|
|
This is by design. There is nothing in the job logic currently that would make it to stop. The job is designed to run forever checking every 10 seconds if the required window is open and if yes, kicking off the macro. As long as the window is open, the job will do the same thing every 10 seconds. And you don't really want to stop the job completely, because if you disable it or kill it, the next time you open the same web page, the job is not going to be running there and 24x7 will not be able to detect page opening.
What you likely want to do is to have the job pause for some time, maybe run the macro and wait for 5 minutes before resuming window/page checks. Or perhaps close the browser window after the macro is run, so that the process doesn't repeat until you open the page again.
It is also possible to compare window handles and make the job remember last handle, so whenever it finds the window again, it can check if the handle is the same or different and only kick off the required macro when the handle is different, otherwise skip the macro wait 10 seconds and check again. Just keep in mind this should be an always on job running endless loop and checking for the window every nnn seconds. I used 10 seconds only as an example, you can change it to anything you want.
|
|
Mon Jun 16, 2008 3:58 pm |
|
 |
Vitae1313
Joined: 05 Jun 2008 Posts: 11 Country: United States |
|
|
|
So, by design, the script you gave me will every 10 seconds run the macro once the page is found?....That is far and away what my original was.
I wanted something that would run ONLY every time a certain page came up.
Having a script run every 10 seconds isn't even close.
changing the Wait time then makes it NO different from the job that runs the macro and that was what I wanted to get rid of.
When the page loads up I want it kick off the macro, then WAIT until that page comes up again.
Not just start running it every 10 seconds. Kills the whole point of what it is doing.
Maybe at this point I should use the macro one and extend the delay time further than what I would like because it's becoming apparent having this do what I want is no possible.
|
|
Mon Jun 16, 2008 4:08 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
|
|
I just gave you an idea how to implement window appearance checks and how to make the job run such checks in a loop. Obviously you need to finish the "business logic" in this job. I hope you don't expect me to write it for you? What you want is surely doable, you just need to make the script to do what you need to do. For beginning you need to decide what to do if the window remains open till the next check. Whether you make the script to postpone the check or make it more sophisticated, you still need to add these "things" to the job logic.
From your recent descriptions it sound like comparing window handles will do exactly what you want. Again as an idea: have the script to save window handle into some variable, add a check to compare if the found handle is the same as the saved, if yes, wait for next check, if no run the macro. I have already described this in detail in my previous message.
PS. Also please think, what you are going to do if more than one browser window gets open with the same page loaded.
|
|
Mon Jun 16, 2008 4:22 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|