Preciso de ajuda em um evento click, não estou conseguindo executar o mesmo quando o valor do ID é achado
getElementsByTagName("button") = "__bar2-btnGo", após entrar na condição do if e for verdadeiro, o evento click não faz nada, nem erro retorna. Desde já obrigado.
Código: Selecionar todos
<button id="__bar2-btnGo" data-sap-ui="__bar2-btnGo" aria-describedby="__text22" title="Iniciar" class="sapMBarChild sapMBtn sapMBtnBase sapMBtnInverted"><span id="__bar2-btnGo-inner" class="sapMBtnEmphasized sapMBtnHoverable sapMBtnInner sapMBtnText sapMFocusable"><span class="sapMBtnContent" id="__bar2-btnGo-content"><bdi id="__bar2-btnGo-BDI-content">Iniciar</bdi></span></span></button>
<span id="__bar2-btnGo-inner" class="sapMBtnEmphasized sapMBtnHoverable sapMBtnInner sapMBtnText sapMFocusable"><span class="sapMBtnContent" id="__bar2-btnGo-content"><bdi id="__bar2-btnGo-BDI-content">Iniciar</bdi></span></span>
<span class="sapMBtnContent" id="__bar2-btnGo-content"><bdi id="__bar2-btnGo-BDI-content">Iniciar</bdi></span>
Código: Selecionar todos
[float=left]Set objCollection = IE.Document.getElementsByTagName("button")
For Each objElement In objCollection
If objElement.ID = "__bar2-btnGo" Then objElement.Click
textoButton = objElement.ID
Next objElement
Set objCollection = IE.Document.getElementsByTagName("button")
For Each objElement In objCollection
If objElement.ID = "__bar2-btnGo" Then IE.Document.getElementById("__bar2-btnGo").Click
textoButton = objElement.ID
Next objElement[/float]