Jump to content

Java applets and page loads


DMW
 Share

Recommended Posts

Although I am not at liberty to discuss the exact contents of my script, I need some help with the basic idea, regarding my problem.

It appears that - although the rest of the script works fine - my script can't tell when a java applet has finished loading. It knows when any other page I tell it to go to is done loading (via the IELoadWait command), but it won't do anything after a page containing a java applet finishes loading.

Any suggestions?

DMW

Link to comment
Share on other sites

Unfortunately there is little you can do unless the Java APPLET/OBJECT is coded to tell you. You can communicate with some using the "param"eters ot the APPLET or OBJECT tag, but only if it is coded to do so. Otherwise, the browser simply serves as a container, alloting a specific amount of space for it.

Perhaps you can trigger off of pixel colors... _IEPropertyGet will give you coordinates of an object you can use for this...

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I'm not sure of exactly how to do that.

Suppose I want the presence of the color (in hex) 7C4F01 (which - in ms paint - should be 124 red, 79 green, 1 blue) to trigger another program. How would I do that?

DMW

Link to comment
Share on other sites

See PixelGetColor in the helpfile and then search for examples in the forum...

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • 1 year later...

I know its been a while since this post was created, but I was having trouble with this feature and couldn't find the answer. I've come up with a simple method that seems to be working for me so I thought I'd share.

This is in regard to testing to see when a Java Applet withint a browser window finishes loading. I just started working with AutoIT earlier this week to see if it would provide some automation I needed.

I have some devices I need to log into and get some logs via http. The login (username, password and "Login" button) are pieces of a java applet.

I put an extra carriage return in so its easier to notice the piece that's handling the work here.

#include <IE.au3>
$oIE = _IECreate ("<http://xxx.xx.xx.com>",1,1,0)
WinActivate ("[CLASS:IEFrame]","<Browser Window Name>") 
_IELoadWait ($oIE)

$test=ControlClick("]","<Browser Window Name>", "", 3)
While $test=0
sleep (1000)
$test=ControlClick("]","<Browser Window Name>", "", 3)
WEnd

sleep (1000)
ControlSend("]","<Browser Window Name>", "", "[CLASS:Edit; INSTANCE:3]", "username")
Send ("{TAB}")
ControlSend("]","<Browser Window Name>", "", "[CLASS:Edit; INSTANCE:4]", "password")
Send ("{TAB}")
Send ("{ENTER}")

All that's happening here is I'm testing for the result of "1" or "0" for clicking in the username field of the applet. If the click is not successful, it returns a "0"...so the script waits 1 second and then tries again. It continues to do this until the click into the username field results in a "1", success.

This has worked whether the applet take 2 seconds or 15 seconds to load.

I know this may not work for all scenarios, for example if you cannot get the control or instance of the applet's pieces, but hopefull it will help with some.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...