Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-15-2019, 04:01 AM
Nico Nico is offline
Registered User
 
Join Date: Feb 2019
Posts: 12
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
Reply With Quote
  #2  
Old 02-15-2019, 08:15 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
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
Reply With Quote
  #3  
Old 02-20-2019, 01:26 AM
Nico Nico is offline
Registered User
 
Join Date: Feb 2019
Posts: 12
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
I don't have any erraters and the web page "google" is displayed

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
Thank you

Last edited by ekoranyi; 02-20-2019 at 12:16 PM.
Reply With Quote
  #4  
Old 02-20-2019, 12:24 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
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
Reply With Quote
  #5  
Old 02-21-2019, 01:34 AM
Nico Nico is offline
Registered User
 
Join Date: Feb 2019
Posts: 12
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.
Reply With Quote
  #6  
Old 02-21-2019, 03:44 AM
Nico Nico is offline
Registered User
 
Join Date: Feb 2019
Posts: 12
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 !
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:57 PM.