TESTARtool / TESTAR_dev

TESTAR, automated testing through the Graphical User Interface
http://www.testar.org
BSD 3-Clause "New" or "Revised" License
37 stars 24 forks source link

Webdriver policyAttributes multi map #323

Closed ferpasri closed 1 year ago

ferpasri commented 1 year ago

The variable policyAttributes that allow users to declare a List of attributes to identify and close policy popups is a Map that does not support the declaration of multiple attributes using the same Map.Key.

https://github.com/TESTARtool/TESTAR_dev/blob/3db158a5aba4ea21c4154c76909f2e1beba5b70e/testar/src/org/testar/protocols/WebdriverProtocol.java#L104

For example, declaring two policy buttons using the same key (class) will only enable the usage of the last value (btn-accept):

policyAttributes.put("class", "btn-cancel");
policyAttributes.put("class", "btn-accept");

A possible solution for this improvement is to allow multiple declarations of values for the same key is to use a MultiMap:

Multimap<String, String> policyAttributes = ArrayListMultimap.create();
ferpasri commented 1 year ago

Solved with #332