0

estou tendo problemas ao acessar um "menu interativo" usando a biblioteca Selenium no VBA.

segue código html da pagina:

    <html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Planejamento, Orçamento e Gestão</title>
    <link href="/css/barra.css" rel="stylesheet" type="text/css" />
    <link href="/css/styleGOV.css?20012017121545" type="text/css" rel="stylesheet" />

</head>
<body>
        <div id="Header">
            <div class="header">
                <h1 class="top-title-header">Portal de Compras do Governo Federal </h1>             
                <h1 class="title-header">Comprasnet</h1>
                <h1 class="bottom-title-header">MINIST&Eacute;RIO DO PLANEJAMENTO OR&Ccedil;AMENTO E GEST&Atilde;O</h1>
                <div class="info">
                    <span class="orgao">

                          MINIST&Eacute;RIO DO PLANEJAMENTO<br/>Brasília, 20 de Janeiro de 2017 
                    </span>

                        <span class="user">
                        EDUARDO RODRIGUES VIANA
                        </span>

                </div>
            </div>
            <div class="menu-header">
                <div class="content-menu">

                        <span class="ambiente-producao">SIASG - Ambiente Produção</span>

                </div>  
            </div>  
        </div>
    <!-- Inicializacao e construcao do menu -->
    <script type='text/javascript'>function Go() { return }</script>  
    <script type='text/javascript' src='../includes/HorizontalFrames_var.js'></script>
    <script type="text/javascript">

    var NoOffFirstLineMenus=2
    Menu1=new Array("Serviços do Governo", "", "", 5,25, 200, "#01430C", "#01430C", "white", "white", "", "", -1, 0, -1, "center", " ");
Menu1_1=new Array("Troca de Senha","/gerencial/troca_senha.asp","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2=new Array("SIASGWeb","","",4,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_1=new Array("SIDEC","","",2,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_1_1=new Array("Aviso","/gerencial/sidecweb/menu.asp?Id=13","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_1_2=new Array("Imprensa","/gerencial/sidecweb/menu.asp?Id=17","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_2=new Array("SICON","","",2,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_2_1=new Array("Cronograma","/gerencial/siconweb/menu.asp?Id=85","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_2_2=new Array("Cronograma Entidade não SISG","/gerencial/siconweb/menu.asp?Id=264","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_3=new Array("SISRP","","",1,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_3_1=new Array("Ata","/gerencial/sisrpweb/menu.asp?Id=210","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_2_4=new Array("CLASSIFICADOS","/gerencial/classificados/menu.asp?Id=243","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_3=new Array("SIASGNet","","",2,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_3_1=new Array("IRP","/gerencial/Gerencial_SIASGNet.asp?ID=10","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_3_2=new Array("Divulgação Compras","/gerencial/Gerencial_SIASGNet.asp?ID=30","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_4=new Array("Pregão","","",4,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_4_1=new Array("Equipe do Pregão","/gerencial/msgBloqueioCertificado.asp","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_4_2=new Array("Pregão Eletrônico","/gerencial/msgBloqueioCertificado.asp","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_4_3=new Array("Pregão Presencial","/gerencial/msgBloqueioCertificado.asp","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_4_4=new Array("Pregão Presencial SRP","/gerencial/msgBloqueioCertificado.asp","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_5=new Array("Cotação Eletrônica","","",5,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_5_1=new Array("Todas em Andamento","/assinadas/cotacao.asp?filtro=andamento","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_5_2=new Array("Adjudicar","/assinadas/cotacao.asp?filtro=adjudicar","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_5_3=new Array("Consultar Relatórios","/assinadas/cotacao.asp?filtro=encerradas","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_5_4=new Array("Consultar Fornecedores","/assinadas/cotacao.asp?filtro=consForn","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");
Menu1_5_5=new Array("Cancelar toda a cotação","/assinadas/cotacao.asp?filtro=cancelartoda","",0,23,220, "", "", "", "", "", "", -1, -1, -1, "left", " ");

    Menu2=new Array("Sair","/logoff.asp","",0,25,70,"#01430C","#01430C","white","white","","",-1,0,-1,"center"," ");

    </script>
    <script type='text/javascript' src='../includes/menu132_com.js'></script>

</body>
</html>

estou tentando "passar" o mouse por cima do elemento da seguinte maneira:

Set objCollection = driver.findElementByCssSelector("frame[name='main2']")
    driver.SwitchToFrame (objCollection)

    driver.FindElementByXPath("/html/body/div[2]/div[1]").Focus

Mas não estou tendo sucesso, qualquer ajuda acerca agradeço desde já!

2
  • continuo aceitando sugestoes de como desbloquear os popups e acessar o menu via codigo 7/02/2017 às 17:07
  • se achou útil vote na resposta 7/02/2017 às 17:18

1 Resposta 1

0

gente, consegui contornar o problema passando as coordenadas para o mouse, ai vai o codigo:

'desbloqueia os pop ups
    SetCursorPos 985, 70 'x and y position
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
    SetCursorPos 800, 143 'x and y position
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
    SetCursorPos 860, 210 'x and y position
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

'faz a interação com o menu
    SetCursorPos 150, 250 'x and y position
    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 3
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime
    SetCursorPos 150, 325 'x and y position
    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 3
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime
    SetCursorPos 400, 325 'x and y position
    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 3
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

porém não tenho certeza se esta aplicação é segura. continuo aceitando sugestoes de como desbloquear os popups e acessar o menu via codigo

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .