A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/robotframework/SwingLibrary/issues/102 below:

Find a label using it's text · Issue #102 · MarketSquare/SwingLibrary · GitHub

Currently (swinglibrary 1.9.7), finding a label is possible using only it's index or name. But usually SwingUI developers tend to forget or not give any names to the most of the components for e.g. buttons, labels etc. So wouldn't be nice to add an ability to look for a label using it's text similar to the way we find buttons? This will help with the keywords Label Should Exist, Label Should Not Exist etc. Using text is more reliable than using index.

Changing LabelOperatorFactory.java from
public LabelOperator createOperatorByName(String name) { return new LabelOperator((ContainerOperator) Context.getContext(), new ByNameComponentChooser(name)); } }

to

public LabelOperator createOperatorByName(String name) { return new LabelOperator((ContainerOperator) Context.getContext(), new ByNameOrTextComponentChooser(name)); } }

will do the trick. If my request makes any sense to you people, let me know I will work on it.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4