Results 1 to 8 of 8

Thread: How to handle Multiple Task Properly?

  1. #1

    Thread Starter
    Member buzz4rd's Avatar
    Join Date
    Feb 2012
    Posts
    42

    Exclamation How to handle Multiple Task Properly?

    Hi, I made a browser automation for a specific site. I used Timer to handle the task one by one. But sometimes it stuck. What's the best Practice to Handle this kind of browser automation with Multi Tasking Properly?
    please

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to handle Multiple Task Properly?

    I'm afraid that your question is rather too vague to give much meaningful advice but there's every chance that the way you're using a Timer or even that you're using a Timer at all is the issue. We'd have to know far more about the specifics though.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member buzz4rd's Avatar
    Join Date
    Feb 2012
    Posts
    42

    Re: How to handle Multiple Task Properly?

    Ok, Let me Make it clear. I have to Fillup form and Click Register button. After clicking Register button I simply disable the Timer untile getting the registration response because IF I Enable Timer It clicks Register Button Frequently. In this circumastances, due to slow Internet connection I have to wait 20/30 seconds Or even more than 1/2 minutes to get any response. But unluckly If It does not Get response It would Remain stuck. So, My Question is: IS timer best option for this type of Browser Automation?
    please

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to handle Multiple Task Properly?

    Are you talking about a WebBrowser control in your own form? That's rather pertinent information.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Member buzz4rd's Avatar
    Join Date
    Feb 2012
    Posts
    42

    Re: How to handle Multiple Task Properly?

    Yes, I'm using GeckoFX 33.0.
    please

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to handle Multiple Task Properly?

    Quote Originally Posted by buzz4rd View Post
    Yes, I'm using GeckoFX 33.0.
    That would fall under the category of "specifics". I've never used that control so I can't really help much further with it specifically but I will say that the standard WebBrowser control has a DocumentCompleted event that notifies you when a page has finished loading so you should probably look for something similar in the control you are using.

    That said, if there's a chance that you might not get such an event because a page fails to load then you probably should use a Timer, but not in the way that you currently are. Each time you perform an action that navigates to another page, you could start a Timer as a failsafe. If you get a DocumentCompleted event or the like before the Timer Ticks then you Stop the Timer and perform the next action. If the Timer Ticks first then you would consider the action to have timed out and you can then proceed accordingly. It's up to you to set the Interval of the Timer to a suitable value for the timeout on each action.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Member buzz4rd's Avatar
    Join Date
    Feb 2012
    Posts
    42

    Re: How to handle Multiple Task Properly?

    Thank you. Actually, I'm also using DocumentCompleted event in Gecko. It's much More Advance than IE. But sometimes it stucks. It's not Just registration there are many Tasks after Registration. That's why I'm looking for proper solution.
    please

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to handle Multiple Task Properly?

    The DocumentCompleted event is the way to determine that a document has loaded. If there's no event that indicates that a document has failed to load then you would use a Timer to create your own timeout mechanism. That's basically it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width