#1
|
|||
|
|||
Open Local Url with IE object
Hello,
I have a problem : When I Run the following code, with a web URL I have not erros : #$language = "VBScript" #$interface = "1.0" ' Get a reference to IE's Application object Set g_objIE = CreateObject("InternetExplorer.Application") 'g_objIE.Offline = True g_objIE.Offline = False g_objIE.navigate "www.google.fr" ' This loop is required to allow the IE object to finish loading... Do crt.Sleep 100 Loop While g_objIE.Busy ' Prevent the MenuBar, StatusBar, AddressBar, and Toolbar from ' being displayed as part of the IE window g_objIE.MenuBar = False g_objIE.StatusBar = False g_objIE.AddressBar = False g_objIE.Toolbar = False ' Set the initial size of the IE window g_objIE.height = 500 g_objIE.width = 700 ' Set the title of the IE window g_objIE.document.Title = "Sofrastock Welcomme" g_objIE.Visible = True ' This loop is required to allow the IE window to fully display ' before moving on Do crt.Sleep 100 Loop While g_objIE.Busy ' This code brings the IE window to the foreground (otherwise, the window ' would appear, but it would likely be behind the SecureCRT window, not ' easily visible to the user). Set objShell = CreateObject("WScript.Shell") objShell.AppActivate g_objIE.document.Title ' Once the dialog is displayed and has been brought to the ' foreground, set focus on the control of our choice... 'g_objIE.Document.All("Username").Focus ' Wait for user interaction with the dialog... crt.Sleep 200 But when I try to Run the same code with a local URL , I have Unknown errors. Why does this happen? Thank you ![]() |
#2
|
|||
|
|||
Hi Nico,
I'm sorry to hear you're having trouble. What version of SecureCRT are you running? To get a better picture of what is happening I would like to gather some additional information. Can you elaborate on what you mean by local URL? What is the exact error message you're seeing?
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Hello,
Thank you for your answer, my version of SecureCRT : 6[1].1.1 When I try with this code : Code:
#$language = "VBScript" #$interface = "1.0" ' Get a reference to IE's Application object Set g_objIE = CreateObject("InternetExplorer.Application") 'g_objIE.Offline = True g_objIE.Offline = False g_objIE.navigate "www.google.fr" ' This loop is required to allow the IE object to finish loading... Do crt.Sleep 100 Loop While g_objIE.Busy ' Prevent the MenuBar, StatusBar, AddressBar, and Toolbar from ' being displayed as part of the IE window g_objIE.MenuBar = False g_objIE.StatusBar = False g_objIE.AddressBar = False g_objIE.Toolbar = False ' Set the initial size of the IE window g_objIE.height = 400 g_objIE.width = 425 ' Set the title of the IE window g_objIE.document.Title = "Sofrastock Welcomme" g_objIE.Visible = True ' This loop is required to allow the IE window to fully display ' before moving on Do crt.Sleep 100 Loop While g_objIE.Busy ' This code brings the IE window to the foreground (otherwise, the window ' would appear, but it would likely be behind the SecureCRT window, not ' easily visible to the user). Set objShell = CreateObject("WScript.Shell") objShell.AppActivate g_objIE.document.Title ' Once the dialog is displayed and has been brought to the ' foreground, set focus on the control of our choice... 'g_objIE.Document.All("Username").Focus ' Wait for user interaction with the dialog... crt.Sleep 200 And with local url, using wampserver, I have this error : Error: UNknown error File: D:\name.vbs Line: 11 code who generate this error : Code:
#$language = "VBScript" #$interface = "1.0" ' Get a reference to IE's Application object Set g_objIE = CreateObject("InternetExplorer.Application") 'g_objIE.Offline = True g_objIE.Offline = False g_objIE.navigate "http://localhost/demo/public/reference" ' This loop is required to allow the IE object to finish loading... Do crt.Sleep 100 Loop While g_objIE.Busy ' Prevent the MenuBar, StatusBar, AddressBar, and Toolbar from ' being displayed as part of the IE window g_objIE.MenuBar = False g_objIE.StatusBar = False g_objIE.AddressBar = False g_objIE.Toolbar = False ' Set the initial size of the IE window g_objIE.height = 400 g_objIE.width = 425 ' Set the title of the IE window g_objIE.document.Title = "Sofrastock Welcomme" g_objIE.Visible = True ' This loop is required to allow the IE window to fully display ' before moving on Do crt.Sleep 100 Loop While g_objIE.Busy ' This code brings the IE window to the foreground (otherwise, the window ' would appear, but it would likely be behind the SecureCRT window, not ' easily visible to the user). Set objShell = CreateObject("WScript.Shell") objShell.AppActivate g_objIE.document.Title ' Once the dialog is displayed and has been brought to the ' foreground, set focus on the control of our choice... 'g_objIE.Document.All("Username").Focus ' Wait for user interaction with the dialog... crt.Sleep 200 Last edited by ekoranyi; 02-20-2019 at 12:16 PM. |
#4
|
|||
|
|||
Hi Nico,
If you manually open Internet Explorer and enter the address "http://localhost/demo/public/reference" are you able to successfully connect? If you replace localhost with the IP address of your machine does that change the behavior you see? Code:
"http://<local IP address>/demo/public/reference"
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
Open local Url
Hello,
Thank you for your answer Yes if I open Internet explorer and enter the adress : "http://localhost/demo/public/reference" I'm able to successfully connect If I replace localhost with my IP address I have this error when the web page is displayed : 403 Forbidden thank you. |
#6
|
|||
|
|||
Open local Url
Hello,
I just configure my local server wamp, with my address IP and it's run successfully ! Thank you very much for your help ! |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|