cisco-open-source / qtwebdriver

WebDriver implementation for Qt
https://github.com/cisco-open-source/qtwebdriver/wiki
197 stars 59 forks source link

Select a QComboBox #71

Open chruetli opened 4 years ago

chruetli commented 4 years ago

How can I select an item from a QComboBox? The Select from Selenium doesn't work.

from selenium import webdriver
from selenium.webdriver.support.select import Select

driver = webdriver.Remote(...)

myComboBox = driver.find_elements_by_xpath("//QComboBox[@id='aComboBox']")[0]
select = Select(privLevelCBox)

UnexpectedTagNameException: Message: Select only works on <select> elements, not on <QComboBox>
kraemer-sw commented 4 years ago

myComboBox.send_keys("label") is the solution...