Closed DiQuintino closed 1 year ago
The url does not work for me... But just a guess - why are you sending {ENTER}
to the browser window? Why don't you send keys.Enter
to the target WebElement
?
Dim keys as Keys
...
...
driver.FindElementByClass("chosen-search-input").SendKeys vCityOrigin
driver.FindElementByClass("chosen-search-input").SendKeys keys.Enter
Also consider casting the target element as a SelectElement
:
Dim selectElem As SelectElement
...
...
Set selectElem = driver.FindElementByClass("chosen-search-input").AsSelect
selectElem.SelectByValue "Montes Claros"
Again... just guessing without being able to navigate to url...
I still cannot navigate to that one - maybe because it's an insecure (http vs https) connection...
Helps if I send here the page code?
Source:
<html>
<body>
<!--StartFragment-->
<form action="/atendimento/nossas-unidades" method="post" class="boxsearch">
--
| <div class="input-group">
| <input title="Digite os termos que você deseja procurar." placeholder="Buscar" class="form-control form-text" type="search" name="searchword" id="mod-search-searchword" maxlength="200">
| <span class="input-group-btn">
| <button type="submit" class="btn btn-primary"><span class="icon glyphicon glyphicon-search" aria-hidden="true"></span></button>
| </span>
| </div>
| <input type="hidden" name="task" value="search" />
| <input type="hidden" name="option" value="com_search" />
| <input type="hidden" name="Itemid" value="143" />
| </form>
<!--EndFragment-->
</body>
</html>
Relevante Element:
```
Another guess based on your video - does this work? If not, where does it fail?
Dim keys as Keys
...
driver.FindElementByName("id_cidade").Click
driver.FindElementByClass("chosen-search-input").SendKeys vCityOrigin
driver.FindElementByClass("chosen-search-input").SendKeys keys.Enter
Didnt work. Isnt clicking at the search result.
Did u check that the first line of the element code says display none?:
<select name="id_cidade" id="cidade" data-placeholder="Selecione uma Cidade" class="select-unidades chosen-select" tabindex="-1" style="max-width: 300px; margin-right: 15px; margin-bottom: 15px; display: none;">
Ty for yr time Mike.
How do I select a city on a list? I have this site, that i want to type a city and get the address