(If there's a better group for this. please let me know.)
What I'm doing is simple in principle, but I'm a winforms guy, not a
webhead, so I'm at a loss as to where to look for the problem here.
Two of the web sites my program uses can't be driven the easy way
(through the URL) but have forms that have to be filled and submitted.
Both are pretty simple, and in both cases I have it working just fine
- most of the time.
The method is simple - find the HtmlElement that has the value(s) to
be set, and use HtmlElement.SetAttribute to store the value. This
works 100% of the time. The only other step is to find and call the
HtmlElement that submits the form with .InvokeMember("click"). One
website uses a java script for the submission and works every time.
The other uses Post, and works about 70% of the time. (Always fills,
doesn't always submit.)
The one that isn't reliable loads a *lot* of graphics and Flash, and,
all this is happening as nine other pages are also loading in other
WebBrowser controls. I originally assumed there was just too much
going on, and even tried using a timer to give the page time to
"settle" after the DocumentComplete fires, but it makes no difference.
It also makes no difference if it's on a 1.7ghz P4/512m or a 3ghz Dual
Core/2g, so I'm sorta doubting it's a muscle issue. OTOH, if it runs
with only that one site loading, the submit works every time - so
there does seem to be some sort of contention involved.
Can anyone give me any clues as to what I'm looking for here? Better
still, is there some newbie mistake I'm probably making? If nothing
else, I can use a timed retry until the url changes, but I'd much
rather find out I'm just doing something wrong...
MikeB