We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
Just to follow up. I rewrote the test to use dropdown and choose that is fetched:
#Selects the 'Gemalto USB Smart Card Reader 1' item of the 'ComboboxOperatorCardReader' combo box.
reader = "Gemalto USB Smart Card Reader"
app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader.Click()
ComboBox = app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader
for i in range(ComboBox.wItemCount):
Item = aqString.GetListItem(ComboBox.wItemList, i)
if reader in Item:
Log.Message(f"found {Item}")
app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader.ClickItem(Item)
break
reader = "Gemalto IDBridge CT7xx"
ComboBox = app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader
# focus object missing name, Accessibility Insight gives error
ComboBox.Click(335, 13)
Sys.Keys("[Tab]")
for i in range(ComboBox.wItemCount):
Item = aqString.GetListItem(ComboBox.wItemList, i)
if reader in Item:
Log.Message(f"found {Item}")
app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader.ClickItem(Item)
break
But in selenium try/except catches everything, must easier with exception handling.
Just to follow up. I rewrote the test to use dropdown and choose that is fetched:
#Selects the 'Gemalto USB Smart Card Reader 1' item of the 'ComboboxOperatorCardReader' combo box.
reader = "Gemalto USB Smart Card Reader"
app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader.Click()
ComboBox = app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader
for i in range(ComboBox.wItemCount):
Item = aqString.GetListItem(ComboBox.wItemList, i)
if reader in Item:
Log.Message(f"found {Item}")
app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader.ClickItem(Item)
break
reader = "Gemalto IDBridge CT7xx"
ComboBox = app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader
# focus object missing name, Accessibility Insight gives error
ComboBox.Click(335, 13)
Sys.Keys("[Tab]")
for i in range(ComboBox.wItemCount):
Item = aqString.GetListItem(ComboBox.wItemList, i)
if reader in Item:
Log.Message(f"found {Item}")
app.MainWindow.TabControl2.TabControlConfig.ItemsControl.ComboboxOperatorCardReader.ClickItem(Item)
break
But in selenium try/except catches everything, must easier with exception handling.
Hi,
Thank you for the update and it is good to know that the problem is solved.
> in selenium try/except catches everything
Selenium (like any other assertion-based library with atomic verifications) architecturally is designed around exceptions and throws exceptions on every failed line of code. Then one has two options: either handle possible expected exceptions (and do not see a problem unless carefully reading test log for details) or have failed test and the necessity to fix it and re-run.
TestComplete, on the contrary, does not throw exceptions on failed actions over UI elements but instead posts a relevant (and clearly visible) message to the test log. What happens next depends on the test project settings: test may be aborted or continued. For some non-critical problems with access to UI elements in a long-playing tests the latter setting gives a chance to end the test and get result that can be reported (in an urgent situations). And then the test may be corrected and executed a-new.
Also, possibility to continue is quite useful during test development.
Just my $0.02 :)