Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keying into proprietary IE based application

Status
Not open for further replies.

JIMFRGH

Programmer
Oct 29, 2009
12
US
I am trying to use Attachmate to run scripted entry into a proprietary system that presents using IE. It seems to me that there should be a way to emulate the keyboard type entry to this web style page, and tab through inputboxes, and buttons, to enter the elements required for the assigned task. I can do it with my keyboard, why not with a script?

I can open the window using...
Set oIE = CreateObject("InternetExplorer.Application")
oIE.navigate(sURL)
oIE.visible = True

but am stuck at this point. The first input is a typed in Username and Password with a "Login" button. The page is written in Javascript, but I was hoping for a generic "keyboard replacement" solution that would allow me to navigate throughout this application, something on the order of o_Session.Screen.Sendkeys("A<Ctrl+M>")

Is this even possible?
 
Sub Main

Dim objShell as object, objIE as object
Set objShell = CreateObject("WScript.Shell")
Set objIE = CreateObject("InternetExplorer.Application")
objIE.navigate ("google.com")

while objIE.busy
msgbox "waiting for app to load"
wend

objShell.AppActivate "Google - Microsoft Internet Explorer"
objIE.visible = true

objShell.SendKeys "Why I shouldn't use sendkeys"
objShell.SendKeys "{ENTER}"
set objIE=Nothing
Set objShell=Nothing

End Sub

[small]Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black[/small]
 
I have been playing with this solution, and have made a great deal of progress. The documentation indicates only the AppActivate, and SendKeys methods. Is there any way to look at, and act upon text that comes up on the screen? Some sort of Area method, or similar capability; possibly a property or method through the Internet Explorer object that would be accessible?
 
Followup on yesterday's question. Is there a way to look at the text in a "Web Page Dialog" box?
 
Check out


Sub Main()

Dim objShell as object, objIE as object
Set objShell = CreateObject("WScript.Shell")
Set objIE = CreateObject("InternetExplorer.Application")

Dim d As Object 'HTMLDocument


objIE.Visible = True
objIE.navigate ("google.com")

Do While objIE.BUSY
msgbox "opening IE"
Loop

Set d = objIE.document
For cnt =0 to d.all.length - 1
if d.all.item(cnt).tagname = "TITLE" then msgbox d.all.item(cnt).text
Next


objIE.Quit
Set OBJie = Nothing

End Sub

[small]Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top