InternetExplorer.Application using Framesets and Frames

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
snakecharmer
Posts: 2
Last visit: Mon Jan 21, 2013 3:06 am

InternetExplorer.Application using Framesets and Frames

Post by snakecharmer »

Good afternoon gentlemen,

I need to make a script that enters an URL, fills in some sign in fields, and then collects some information from there.

I've managed to make a functional script using GMail as an example, and it goes like this:


************************************************************************************************************

Set IE = CreateObject("InternetExplorer.Application")

sURL = "http://www.gmail.com"

With IE
.Navigate sURL
.Visible = True
End With


' loop while it waits for InternetExplorer to load

Do While IE.Busy
Loop


' inputboxes value are assigned to "fname" (login) and "fpwd" (password) variables

fname=InputBox("Enter your name","Userinput")

fpwd=InputBox("Enter your password", "Userinput")


Set UserN = IE.Document.getElementById("Email")
If Not UserN Is Nothing Then
' assigns the fname value to the element "Email"
UserN.Value = fname
End If

Set PW = IE.Document.getElementById("Passwd")
' password
If Not PW Is Nothing Then
' assigns the fpwd value to the element "Passwd"
PW.Value = fpwd
End If


' finds the login button and clicks on it
Set btnInput = IE.Document.getElementById("signIn")
btnInput.Click

***************************************************************************************************************

The above mentioned code works perfectly. However, I need it to work at my job's intranet.

The problem is: the intranet url with the Login and EMail is inside a specific frame, which is inside a frameset (I am completely ignorant when the subject is html and stuff like that).

When I try to use my script, I get the "Unkow Interface" error.

Does anybody know how can I handle the frames properly??

Thanks,

Ricardo Fazzio
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

InternetExplorer.Application using Framesets and Frames

Post by jvierra »

Frames are usually inaccessible. gmail should not be in a frame. Perhaps your browser does not have javascript enabled.
User avatar
snakecharmer
Posts: 2
Last visit: Mon Jan 21, 2013 3:06 am

InternetExplorer.Application using Framesets and Frames

Post by snakecharmer »

jvierra,

The GMail example I've posted works fine. However, this code doesn't work when I try to use it in my job's intranet. The login/password is in a frame called "reg04/consulta_ferias/CFloginficha.shtml". I tried to set the URL variable to this adress, but I keep getting error messages and can't fill the login/password fields properly.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

InternetExplorer.Application using Framesets and Frames

Post by jvierra »

The reason you are getting the frameset is becauselikely due to the version of IE being used or to compatibility settings being enforced by Group Policy or because of firwall settings that do not allow advanced features of the broser to be used.

You will need to recode to discover the frame and to address the contents appropriate. There is no magic switch to accomplish. It is a completely different page.

I have inspected the Google page under all settings an find no indications of frames being used in IE7 and later.
This topic is 11 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked