Page 1 of 1 1
Topic Options
#30951 - 2002-10-18 05:01 PM Open page in Internet explorer and pass values
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Hi,

Is it possible with kix to open Internet Explorer and in my case pass a login name and password to a webmail client? Which is two values on a html form. Then press enter?

Darren [Roll Eyes]

[ 18. October 2002, 17:03: Message edited by: Darren ]
_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
#30952 - 2002-10-18 05:20 PM Re: Open page in Internet explorer and pass values
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
For starters, here's one way to launch IE from Kix
code:
Break On
$IE = CreateObject("InternetExplorer.Application")
$IE.Visible=1
$IE.Navigate("http://www.kixtart.org")
GetS$;just pause for now
$IE.Quit
$IE = 0

Have a lookie here for more info...COM Primer

[ 18. October 2002, 17:24: Message edited by: Waltz ]
_________________________
We all live in a Yellow Subroutine...

Top
#30953 - 2002-10-18 07:17 PM Re: Open page in Internet explorer and pass values
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
you might also want to look into SENDKEYS() in order to send keystrokes to the Internet Explorer window or look at the AutoIT package.
_________________________
There are two types of vessels, submarines and targets.

Top
#30954 - 2002-10-18 07:28 PM Re: Open page in Internet explorer and pass values
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The problem I forsee with SendKeys() is knowing when the page is ready to accept input. I think somehow that you'd have to scrape the screen or get feedback from COM. I think maybe AutoIT can see the screen content but have never worked with it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#30955 - 2002-10-21 10:59 AM Re: Open page in Internet explorer and pass values
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Thanks for your input.

I had a look at autoIT and managed to get it to work, the problem with autoIT not knowing when the page is ready for input I got around with a pause.

Darren [Smile]
_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
#30956 - 2002-10-21 01:57 PM Re: Open page in Internet explorer and pass values
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
You may be able to wait for the page to finish loading with:
code:
While $IE.Busy "Waiting for idle..." ?  Loop


Top
#30957 - 2002-10-21 02:06 PM Re: Open page in Internet explorer and pass values
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
still, I would pass those values directly in your script...
_________________________
!

download KiXnet

Top
#30958 - 2002-10-21 04:11 PM Re: Open page in Internet explorer and pass values
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Ok, here is an example of filling in a form and submitting it automatically.

This example uses the KiXtart search page, and set the following fields:
  • Membership number to "494" (my number)
  • Search forums to "all"
  • Search date to "Since 5 days"
It then submits the search form.
code:
Break On

; Create application instance and open search page...
$oIE = CreateObject("InternetExplorer.Application")
$oIE.Visible=1
$oIE.Navigate("http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=search")

; Wait for page to stop loading...
While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop

$oDoc=$oIE.document

; Form is not named, so identify the form with the relevant field...
For Each $oForm In $oDoc.forms
; Set membership number
$oForm.search_user.value="494"
; If there is no error, then this is the right form
If @ERROR = 0
; Set the period and forum scope
$oForm.search_date.value="5"
$oForm.search_forum.value="ALL"
; Submit the form.
$oForm.submit.click
EndIf
Next

$oIE = 0


Top
#30959 - 2002-10-25 03:27 PM Re: Open page in Internet explorer and pass values
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Hi,

I'm moving away a little from kix here, but does any one know how to set the window to minimised once it has done its thing.

Had a look at the windows developer site and can't seem to find anything.

I have tried useing

code:
  
$oIE.Windowstate=2

but with no luck

Darren [Confused]
_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
#30960 - 2002-10-25 04:25 PM Re: Open page in Internet explorer and pass values
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, you are still using ie and can't understand why as same could be done with xmlhttp object without any windows...

dunno how to minimize normal windows, but do you want to keep it there?
can't you just hide it?
_________________________
!

download KiXnet

Top
#30961 - 2002-10-25 04:43 PM Re: Open page in Internet explorer and pass values
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Hi,

I cant understand what you mean "xmlhttp object without any windows..." my situation is.

I have a simple school network with a local web based email client on a Linux box, I would simply like to open there respective email account for them and minimise it on there desktop.

I do want to keep it there but minimised, hiding it would not be much good as they would not beable to use it...

Darren
_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
#30962 - 2002-10-25 04:59 PM Re: Open page in Internet explorer and pass values
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I'm not sure if this is enough:
-do a file somewhere with extension of .scf
-write the file:
code:
[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
Command=ToggleDesktop

after done with ie, execute that.
it shows desktop (minimizing all windows)
 
_________________________
!

download KiXnet

Top
#30963 - 2002-10-25 05:28 PM Re: Open page in Internet explorer and pass values
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
The WindowState property is only available to HTA Browser Applications (.HTA extentions) which is something i figure you dont want to be using (imho).

Like Jens and Les mentioned - if your lucky enough to have InternetExplorer retain its focus when you start her, might try sending these keys from your script. Might be a hit-and-miss proposition.

$=sendkeys("~ n")

assuming english menus here.

-Shawn

[ 25. October 2002, 17:30: Message edited by: Shawn ]

Top
#30964 - 2002-10-25 10:31 PM Re: Open page in Internet explorer and pass values
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure shawn, as did nothing for me.

did you try mine already?
there should be easier way too...
_________________________
!

download KiXnet

Top
#30965 - 2002-11-05 11:14 AM Re: Open page in Internet explorer and pass values
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Hi,

I have been away for a week, I will test this out later and pass on the results...

Darren
_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
#30966 - 2002-11-05 11:19 AM Re: Open page in Internet explorer and pass values
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Darren,

is :

code:
run "http://user:password@www.yourserver.com

an option for you ?

J.

[ 05. November 2002, 11:20: Message edited by: jpols ]
_________________________



Top
#30967 - 2002-11-06 12:57 AM Re: Open page in Internet explorer and pass values
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Hello,

No [Razz]

The webmail client is Neomail and it does not seem to accept the values sent that way.

Darren
_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
#30968 - 2002-11-05 04:07 PM Re: Open page in Internet explorer and pass values
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Hi,

Using:
code:
  
$=sendkeys("~ n")

Working with Internet explorer that works for minimising the window.

Thanks [Big Grin]

This is my final code...

code:
 
Break On

; Create application instance and open search page...
$oIE = CreateObject("InternetExplorer.Application")
$oIE.Visible=1
$oIE.Navigate("webmail.aschoolname.bristol.sch.uk")

; Wait for page to stop loading...
While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop

$oDoc=$oIE.document

; Form is not named, so identify the form with the relevant field...
For Each $oForm In $oDoc.forms
; Enter user ID
$oForm.userid.value="admin"
; If there is no error, then this is the right form
If @ERROR = 0
; Enter password
$oForm.password.value="{password}"
; Submit the form.
$oForm.submit.click
EndIf
Next

$oIE = 0
$=sendkeys("~ n")

Darren

[ 05. November 2002, 16:12: Message edited by: Darren ]
_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 1300 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.04 seconds in which 0.014 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org