Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Issue need your help: How to control combox/dropdownlist in web page?

Reply
 
Old 04-28-2007   #1 (permalink)


 
 

Issue need your help: How to control combox/dropdownlist in web page?

Hi,

Here is an issue need your help, very appricate you if can provide any ideas...

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Web")
$webclient = new-object System.Net.WebClient

$oIE=new-object -com internetexplorer.application
$oIE.visible=$true

$oIE.navigate2($passportSignUP)
while ($oIE.busy) {
sleep -milliseconds 1000
}

sleep -milliseconds 3000
$oIE.document.getElementById("imembername").value = $myidalias
$oIE.document.getElementById("iPwd").value = "password"
$oIE.document.getElementById("iRetypePwd").value = "password"
$oIE.document.getElementById("iSQ").SelectedIndex = "1"
$oIE.document.getElementById("iSA").value = "The Green Mile"
$oIE.document.getElementById("iFirstName").value = "Min"
$oIE.document.getElementById("iLastName").value = "Zhang"


When you in Windows Live ID sign up page, we can type text in textbox easily by DOM method e.g. $oIE.document.getElementById("iSA").value = "The Green Mile" , but how to control combox/dropdownlist in web page?

Thanks much for your help!
Belem

My System SpecsSystem Spec
Old 05-01-2007   #2 (permalink)
Don Jones [MVP]


 
 

Re: Issue need your help: How to control combox/dropdownlist in web page?

What do you mean by "control?" You should be able to just set the
drop-down's Value property if you want to change its value. I believed you
can change the Selected property of an <Option> object to force it to be
selected, but there's no programmatic way to visually "drop" the list.

You might re-post in one of the DHTML newsgroups, as this is the type of
thing those guys deal with almost daily - you really need to know how the
DOM does this, rather than how the IE COM object behaves or how PowerShell
treats it.

--
Don Jones
Windows PowerShell MVP
Founder: www.ScriptingAnswers.com
Co-Author: "Windows PowerShell: TFM"

"belem" <belem.2pqg81@no-mx.forums.net> wrote in message
news:belem.2pqg81@no-mx.forums.net...
>
> Hi,
>
> Here is an issue need your help, very appricate you if can provide any
> ideas...
>
> [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Web")
> $webclient = new-object System.Net.WebClient
> $oIE=new-object -com internetexplorer.application
> $oIE.visible=$true
>
> $oIE.navigate2($passportSignUP)
> while ($oIE.busy) {
> sleep -milliseconds 1000
> }
> sleep -milliseconds 3000
> $oIE.document.getElementById("imembername").value = $myidalias
> $oIE.document.getElementById("iPwd").value = "password"
> $oIE.document.getElementById("iRetypePwd").value = "password"
> $oIE.document.getElementById("iSQ").SelectedIndex = "1"
> $oIE.document.getElementById("iSA").value = "The Green Mile"
> $oIE.document.getElementById("iFirstName").value = "Min"
> $oIE.document.getElementById("iLastName").value = "Zhang"
>
> When you in Windows Live ID sign up page, we can type text in textbox
> easily by DOM method e.g. $oIE.document.getElementById("iSA").value =
> "The Green Mile" , but how to control combox/dropdownlist in web page?
>
> Thanks much for your help!
> Belem
>
>
> --
> belem


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Control IE et save a Web Page PowerShell
How to copy dropdownlist to each other? .NET General
control panel page as a shortcut ? Vista General
ActiveX Control prompt "An ActiveX control on this page might be u Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46