0

How can i select this combobox and click to select the options ?
When load that combobox again that always create a new id, so i can't use id.

HTML:

<input id="combobox-1168-inputEl" type="text" 
       class="x-form-field x-form-text  x-trigger-noedit x-form-focus x-field-form-focus x-field-default-form-focus"
       autocomplete="off" name="combobox-1168-inputEl"
       readonly="readonly" tabindex="1" 
       aria-invalid="false" data-errorqtip="" 
       style="width: 100%; -webkit-user-select: text;">

I'm trying to use xpath looking for the class:

teste2 = browser.find_by_xpath("//input[contains(@class,'x-form-field.x-form-text..x-trigger-noedit.x-form-focus.x-field-form-focus.x-field-default-form-focus')]")

But it return:

In [122]: teste2
Out[122]: []

How can I do it ?

AbcAeffchen
  • 14,400
  • 15
  • 47
  • 66
Rfranca
  • 53
  • 7
  • A simple search on SO returns many results. Did you try any of those? – SiKing Jul 09 '14 at 19:54
  • possible duplicate of [Any suggestions for testing extjs code in a browser, preferably with selenium?](http://stackoverflow.com/questions/107314/any-suggestions-for-testing-extjs-code-in-a-browser-preferably-with-selenium) – SiKing Jul 09 '14 at 19:55
  • I could find the element, but my problem now is that phantomjs click() is not working properly. I have found the element and i click on the element but my screenshot beforclick and afterclick are the same. Nothing happens after the click. – Rfranca Jul 23 '14 at 17:47
  • Is this now a new question? Need to see some code, everything else is just guesswork. Have a look at this: https://stackoverflow.com/help/mcve – SiKing Jul 23 '14 at 19:34
  • Thanks SiKing. It's a new question, but this one was solved. – Rfranca Jul 28 '14 at 17:58

1 Answers1

0

I'm using find_elements_by_xpath, because I have a few elements with the same class, so I used find_elements and used the results as a list and I selected the index that I need. With this steps I could select and be happy with the results.

Rfranca
  • 53
  • 7