problem to popular an option type control

Asked

Viewed 148 times

1

I have a VBA code but I’m having problems to the popular one element.

When having put data in control appears the following error message:

runtime error '2146233079 (80131509)': Unknown error: cannot Focus element...

Sub x()
    Dim objCollection
    Dim numeroPregao, dataAssinatura, uasg, item, val, m
    Dim c As Integer
    Dim ULogin As Boolean, ieForm
    Dim MyPass As String, MyLogin As String
    Dim driver As New SeleniumWrapper.WebDriver
    Dim windowHandleJanelaInicial As String

    ctr = 2
    For y = 0 To 13680 'vai de zero ao numero de linhas a ser prenchido
    m = 0
    c3 = 1
    c2 = 1

    driver.Start "chrome", "http://comprasnet.gov.br"
    driver.setImplicitWait 5000
    driver.Open "/acesso.asp?url=/Livre/Ata/ConsultaAta00.asp"

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

    driver.FindElementByName("dt_ini").SendKeys "25/11/2015"
    driver.FindElementByName("dt_fim").SendKeys "24/11/2015"
    driver.FindElementByXPath("//option[text()='<Escolha pelo menos um material ou serviço>']").SendKeys "222345" 'o erro ocorre aqui
  • Doing a debug, where the error is?

  • in the last line 'the error occurs here

  • I believe the labeled xpath is wrong...

1 answer

0


I managed to get around my error! the problem was occurring because the control I was trying to manipulate was not "accessible".

The way was to click the button "select" and interact with popup controls material selection

Browser other questions tagged

You are not signed in. Login or sign up in order to post.