Sign in to follow this  
Followers 0
Regency

Hekp with _ieformoptionselect

2 posts in this topic

So cant for the life of me figure out how to make the drop down menu change. here is the source..

<option selected="selected" value="1">Handgun FMJ</option>
<option value="2">Handgun JHP</option>
<option value="3">Rifle FMJ</option>
<option value="4">Rifle JHP</option>
<option value="5">Sniper FMJ</option>
<option value="6">Sniper JHP</option>

and here is what i got in autoit...

Func BulletProduce()
    $oUser = _IEGetObjByName($LoginPage, "Login1$UserName")
    _IEFormElementSetValue($oUser, $name1)
    $oPass = _IEGetObjByName($LoginPage, "Login1$Password")
    _IEFormElementSetValue($oPass, $pass1)
    $oLogIn = _IEGetObjByName($LoginPage, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($LoginPage)
    _IENavigate($LoginPage,$Bullet,1)
    _IELoadWait($LoginPage)
    ;Hand JHP
    $Amount = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$txtBullet")
    _IEFormElementSetValue($Amount, "4000")
    $HJhp =  _IEGetObjByName($LoginPage, "ctl00$MainPageContent$ddlBulletType)")
    _IEFormElementOptionselect($HJhp, 2, "2", "byValue")
    _ieaction($HJhp, "click")
    $Produce = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$btnProduceBullets")
    _IEAction($Produce, "click")
    _ieloadwait($LoginPage)
    ;Hand FMJ
    $Amount = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$txtBullet")
    _IEFormElementSetValue($Amount, "4000")
    $HFmj =  _IEGetObjByName($LoginPage, "ctl00$MainPageContent$ddlBulletType)")
    _IEFormElementOptionselect($HFmj, 2, "1", "byValue")
    _ieaction($HFmj, "click")
    $Produce = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$btnProduceBullets")
    _IEAction($Produce, "click")
    _ieloadwait($LoginPage)
    ;Rifle JHP
    $Amount = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$txtBullet")
    _IEFormElementSetValue($Amount, "4000")
    $RJhp =  _IEGetObjByName($LoginPage, "ctl00$MainPageContent$ddlBulletType)")
    _IEFormElementOptionselect($RJhp, 2, "4", "byValue")
    _ieaction($RJhp, "click")
    $Produce = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$btnProduceBullets")
    _IEAction($Produce, "click")
    _ieloadwait($LoginPage)
    ;Rifle FMJ
        $Amount = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$txtBullet")
    _IEFormElementSetValue($Amount, "4000")
    $RFmj=  _IEGetObjByName($LoginPage, "ctl00$MainPageContent$ddlBulletType)")
    _IEFormElementOptionselect($RFmj, 2, "3", "byValue")
    _ieaction($RFmj, "click")
    $Produce = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$btnProduceBullets")
    _IEAction($Produce, "click")
    _ieloadwait($LoginPage)
    ;Sniper JHP
    $Amount = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$txtBullet")
    _IEFormElementSetValue($Amount, "4000")
    $SJhp =  _IEGetObjByName($LoginPage, "ctl00$MainPageContent$ddlBulletType)")
    _IEFormElementOptionselect($SJhp, 2, "6", "byValue")
    _ieaction($SJhp, "click")
    $Produce = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$btnProduceBullets")
    _IEAction($Produce, "click")
    _ieloadwait($LoginPage)
    ;Sniper FMJ
        $Amount = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$txtBullet")
    _IEFormElementSetValue($Amount, "4000")
    $SFmj =  _IEGetObjByName($LoginPage, "ctl00$MainPageContent$ddlBulletType)")
    _IEFormElementOptionselect($SFmj, 2, "5", "byValue")
    _ieaction($SFmj, "click")
    $Produce = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$btnProduceBullets")
    _IEAction($Produce, "click")
    _ieloadwait($LoginPage)
EndFunc

I dont know how to make the _IEFormElementOptionselect to select a different option.. any help?

Share this post


Link to post
Share on other sites

What is output to the SciTe console?

It will be much easier to help you if you simplify your code down to just what you are having trouble with.

The 3rd parameter in _IEFormElementOptionselect should be a 0 or 1... what's up with the values you are using?

Did you try the examples for _IEFormElementOptionselect in the helpfile (actually run them, not just look at them)?

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0