Jump to content

Loop is not working! #IE


Patryk
 Share

Recommended Posts

Dear Colleagues,

I have no idea how to refer to style.display in my loop. There is a button like: 

<input name="ctl00$bodyPlaceholder$btnFecharProcessamento" class="button" id="bodyPlaceholder_btnFecharProcessamento" style="display: none;" onclick="FecharJanelaProcessamento();return false;" type="submit" value="Fechar">

I want it to be clicked as soon as button's style change from style="display: none;" to  style= ="display: inline-block;" 

This is what I got, but it's not working...

Func GetButtons()
$oButtons = _IEGetObjByName($oForm,"ctl00$bodyPlaceholder$btnFecharProcessamento",-1)
$i = 0
While $i <> 1
For $oBtn In $oButtons
    If _IEFormElementGetValue($oBtn) = "Fechar" And $oBtn.document.style.display = "display: inline-block;" Then
       $i = 1
        _IEAction($oBtn, "focus")
        _IEAction($oBtn, "click")
        ExitLoop
    EndIf
 Next
 WEnd
EndFunc

 

I will really appreciate if you could help me with these loop!

Link to comment
Share on other sites

9 minutes ago, Danp2 said:

I would try something like this --

$oBtn = _IEGetObjByName($oForm,"ctl00$bodyPlaceholder$btnFecharProcessamento")

While 1
    If $oBtn.style.display <> 'none' Then
        ExitLoop
    Endif
    
    Sleep(500)
WEnd

_IEAction($oBtn, "focus")
_IEAction($oBtn, "click")

 

It's working! Thanks! you are the best @Danp2 :)

Link to comment
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
 Share

×
×
  • Create New...