PDA

View Full Version : Click in Image with iframe



magushi
11-11-2014, 03:44 AM
Dear , good day.

Need to click a button , but I can not at all.
Below is what I need button click .

Botão: window.document.getElementById("btnAtivo").src = "../images/botoes/bt_ativo.gif"

I tried

idoc.document.document.getElementById("btnAtivo").click
idoc.document.document.getElementById("btnAtivo").onclick

Set ElementCol = Idoc.document.getElementsByTagName("img")

For Each elea In ElementCol

If InStr(elea.innerHTML, "../images/botoes/bt_ativo.gif") > 0 Then
elea.Click

Exit For

End If

Next

* If you can help me thank you .


CODE:

//-->
</script>
<script language="VBScript">

function resultadoVBS()
Dim cIdPessoa
Dim cIdCampanha
Dim cIdPublico
Dim cIdPesquisa
Dim cIdPUPE
Dim cRet

'Danilo - nao permitir abrir tela de resultado enquanto carrega/limpa pessoa
Dim cFinalizando

cFinalizando = parent.parent.item("barrasuperior").hdnFinalizando.value

'msgbox "Finalizando = " & cFinalizando

if (cFinalizando = "S") then
MsgBox "Aguarde o sistema iniciar o novo atendimento."
exit function
end if
'---

cIdPessoa = parent.parent.item("barrasuperior").item("barraNome").frmBarraSuperior.hdnIdPessoa.value

window.parent.parent.msgEmail.value = ""

if (frmComandos.hdnScriptStatus.value = "N") then
if (MsgBox("O script executado não foi salvo!" & vbCrLf & vbCrLf & "Deseja voltar a Tela de Script para Salva-lo?", 292, "TELE IN-OUT") = 7) then
MsgBox "As respostas do cliente serão perdidas.", 48, "TELE IN-OUT"
else
window.parent.parent.superior.AtivarPasta "SCRIPT", false
exit function
end if
end if

if trim(cIdPessoa) <> "" and trim(cIdPessoa) <> "NULL" then
if cLng(cIdPessoa) = 0 then
msgbox "Não há atendimento a ser salvo.", 48, "TELE IN-OUT"
exit function
end if
else
msgbox "Não há atendimento a ser salvo.", 48, "TELE IN-OUT"
exit function
end if

cIdCampanha = parent.parent.item("barrasuperior").item("barraCampanha").item("cmbCampanha").document.frmCmbIdCampanha.hdnIdCampanha.value
cIdPublico = parent.parent.item("barrasuperior").item("barraCampanha").item("cmbCampanha").document.frmCmbIdCampanha.hdnIdPublico.value
cIdPesquisa = parent.parent.item("barrasuperior").item("barraCampanha").item("cmbCampanha").document.frmCmbIdCampanha.hdnIdPesquisa.value
cIdPUPE = parent.parent.item("barrasuperior").item("barraCampanha").item("cmbCampanha").document.frmCmbIdCampanha.hdnIdPUPE.value

if trim(cIdCampanha) = "" then
if (msgbox("Confirme gravação do atendimento", 292,"Encerramento do Chamado") = 7) then
exit function
else
cIdPublicoIdPUPE = replace(cIdPublicoIdPUPE,"#","~")
ifrmSalvaAtendimento.location.href = "contResultadoAtendimento.asp?agrupador1=frmChamado&operador=INS&itmIdChamado=&idPublico=" & cIdPublico & "&idCampanha=" & cIdCampanha & "&idPesquisa=" & cIdPesquisa & "&idPUPE=" & cIdPUPE
bAtendimentoFinalizado = true
parent.telefonia.finalLigacao(false)
end if
else
cIdPublicoIdPUPE = replace(cIdPublicoIdPUPE,"#","~")
'window.open "contResultadoAtendimento.asp?agrupador1=frmChamado&operador=INS&itmIdChamado=&idPublico=" & cIdPublico & "&idCampanha=" & cIdCampanha & "&idPesquisa=" & cIdPesquisa & "&idPUPE=" & cIdPUPE, "", "width=800; height=540"
'Danilo - nao deixar fechar tela de resultado enquanto grava

Do while (cIdCampanha <> "")

cRet = showModalDialog ("contResultadoAtendimento.asp?agrupador1=frmChamado&operador=INS&itmIdChamado=&idPublico=" & cIdPublico & "&idCampanha=" & cIdCampanha & "&idPesquisa=" & cIdPesquisa & "&idPUPE=" & cIdPUPE, window ,"help:no;scroll:no;Status:NO;dialogWidth:950px;dialogHeight:600px,dialogTop: 0px,dialogLeft:50px")

'MsgBox (cRet)

if cRet <> "undefined" and cRet <> "openAgain" then
bAtendimentoFinalizado = true
nCarregarPessoa = "-1"
verificaPausa

if cRet <> empty then
if instr(1, cRet, "|") > 0 then
parent.telefonia.setTelefoniaResultado 0, 1, split(cRet, "|")(0), split(cRet, "|")(1), split(cRet, "|")(2)
if split(cRet, "|")(3) = "S" then
parent.telefonia.quantidade = 0
end if
end if

if parent.telefonia.quantidade > 0 then
parent.telefonia.verificaPessoaPendenteLista
else
parent.telefonia.finalLigacao(false)
end if
end if

exit do
end if

cIdCampanha = parent.parent.item("barrasuperior").item("barraCampanha").item("cmbCampanha").document.frmCmbIdCampanha.hdnIdCampanha.value
loop
end if
end function
</script>
<script type="text/javascript" language="JavaScript" src="../js/funcMess.js"></script>
<script language="JavaScript" type="text/javascript">
var strModoAtual;

function getModoAtual(){
return frmComandos.hdnModoAtual.value
}

function setModoAtual(cModo){
if (cModo == "") {
window.document.getElementById("btnAtivo").src = "../images/botoes/bt_ativo.gif"
window.document.getElementById("btnReceptivo").src = "../images/botoes/bt_receptivo.gif"
frmComandos.hdnModoAtual.value = ""
}
else
ativaModo(cModo)
}

function setModoReceptivo() {
ifrmBuscaPessoaReceptivo.location.href = "atualizaLOATTMAT.asp?nTipoAtendimento=2"
window.document.getElementById("btnAtivo").src = "../images/botoes/bt_ativo.gif"
window.document.getElementById("btnReceptivo").src = "../images/botoes/bt_receptivo03.gif"
frmComandos.hdnModoAtual.value = "RECEPTIVO"
strModoAtual = "RECEPTIVO"
}

function setModoAtivo() {
window.document.getElementById("btnAtivo").src = "../images/botoes/bt_ativo.gif"
window.document.getElementById("btnReceptivo").src = "../images/botoes/bt_receptivo03.gif"
frmComandos.hdnModoAtual.value = "ATIVO"
strModoAtual = "ATIVO"
}

function ativaModo(strModo){

*Thanks

Magushi

westconn1
11-11-2014, 01:32 PM
if the button is within an iframe you will need to find which frame it is in, the work with the document in the frame
without the page source, or better, a link to the page, i would not hazard a guess