Page 1 of 1

InternetExplorer.Application using Framesets and Frames

Posted: Thu Jan 17, 2013 5:58 am
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

InternetExplorer.Application using Framesets and Frames

Posted: Thu Jan 17, 2013 6:38 am
by jvierra
Frames are usually inaccessible. gmail should not be in a frame. Perhaps your browser does not have javascript enabled.

InternetExplorer.Application using Framesets and Frames

Posted: Fri Jan 18, 2013 3:12 am
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.

InternetExplorer.Application using Framesets and Frames

Posted: Sun Jan 20, 2013 5:24 am
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.