Access VBA - Twebst times out after Loging in

73 views
Skip to first unread message

Don Leverton

unread,
Apr 23, 2017, 11:26:58 PM4/23/17
to Twebst
Private Sub cmdTemp_Click()

    On Error GoTo cmdTemp_Click_Error
 
    Dim core As ICore
    Set core = New OpenTwebstLib.core
   
    Dim browser As IBrowser
    Set browser = core.StartBrowser("http://www.napaprolink.ca/prolink/welcome")
   
    Call browser.FindElement("input text", "id=username").InputText("MyUserName")
    Call browser.FindElement("input password", "id=password").InputText("MyPassword")
    Call browser.FindElement("input image", "id=login").Click

************************** Everything works to here and the first URL loads perfectly ***************************************
After logging in the URL in the title bar changes to: http://www.napaprolink.ca/PROLink/Home
*******************************************************************************************************************************************  

    Call browser.FindElement("input text", "id=ctl00_ContentPlaceHolder1_VinTextBox").InputText("MyVIN")
    Call browser.FindElement("input image", "id=ctl00_ContentPlaceHolder1_DecodeVINButton").Click


    On Error GoTo 0
    Exit Sub

cmdTemp_Click_Error:

    Debug.Print "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdTemp_Click of Sub Form_Form1"

End Sub

========================================================================================

It appears that Twebst times out and throws the following error (copied/pasted from the Immediate window):
Error -2147221501 (Page load timeout in FindElement method call!) in procedure cmdTemp_Click of Sub Form_Form1

Any advice for a Twebst newbie?

TIA,
Don

Don Leverton

unread,
Apr 23, 2017, 11:29:30 PM4/23/17
to Twebst
PS.
I'm on Windows 10 and IE 11.


Message has been deleted

Don Leverton

unread,
Apr 25, 2017, 2:37:31 AM4/25/17
to Twebst


OK ... New information: If I set a breakpoint, and step through the code (F8) manually ... it WORKS!!!
However, I have tries all sorts of Pause or Wait functions ... and the problems persist!


I have also tried and failed with "browser.IsLoading" and browser.WaitToLoad
http://codecentrix.com/doc/index.htm
Anyone? Please?


Private Sub cmdTemp_Click()


    On Error GoTo cmdTemp_Click_Error
   
    Dim core As ICore
    Set core = New OpenTwebstLib.core
   
    Dim browser As IBrowser
    Set browser = core.StartBrowser("http://www.napaprolink.ca/prolink/welcome")
    Dim bFinished As Boolean
    Dim i As Integer

    Call browser.FindElement("input text", "id=username").InputText("MyUserName")
    Call browser.FindElement("input password", "id=password").InputText("MyPassword")
    Call browser.FindElement("input image", "id=login").Click
   
'If I set a breakpoint on the above line, and step through the code manually everything works!
'Without the breakpoint: Error -2147221501 (Page load timeout in FindElement method call!) in procedure cmdTemp_Click of Sub Form_Form1

    Call browser.FindElement("input text", "id=ctl00_ContentPlaceHolder1_VinTextBox").InputText("MyVIN")
    Call browser.FindElement("input image", "id=ctl00_ContentPlaceHolder1_DecodeVINButton").Click
   


    On Error GoTo 0
    Set browser = Nothing
    Set core = Nothing


    Exit Sub

cmdTemp_Click_Error:

    Debug.Print "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdTemp_Click of Sub Form_Form1"
    Set browser = Nothing
    Set core = Nothing

End Sub

Robert Benz

unread,
Aug 31, 2018, 2:26:34 PM8/31/18
to Twebst
After you Login (when the site URL changes), reset the browser to make sure it is still "connected". ie:

Set browser = FindBrowser("http://www.napaprolink.ca/PROLink/Home")

Don Leverton

unread,
Sep 1, 2018, 11:11:40 AM9/1/18
to twebst-autom...@googlegroups.com
Thanks, Robert.
I had pretty much given up on this, but will certainly revisit this idea and try your suggestion!

Sent from my iPhone
--

---
You received this message because you are subscribed to a topic in the Google Groups "Twebst" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/twebst-automation-studio/ZKx2zOG3r3s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to twebst-automation-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages