Jump to content
Sign in to follow this  
Regency

Help witth selecting a drop down value

Recommended Posts

Regency

I cant select a drop down value, it goes through the code but doesnt click the value i want..

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($LoginPage, "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, 1, "1", "byValue")
    _ieaction($LoginPage, "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($LoginPage, "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($LoginPage, "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($LoginPage, "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($LoginPage, "click")
    $Produce = _IEGetObjByName($LoginPage, "ctl00$MainPageContent$btnProduceBullets")
    _IEAction($Produce, "click")
    _ieloadwait($LoginPage)
EndFunc

and here is the html values

<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>

anyone got any ideas?

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  

×