@@ -26,10 +26,6 @@ public final class SelectBoxUtils extends TolerantInteraction {
2626 private static final Timer tolerantItemByVisibleTextAction = MetricRegistryHelper .get ().timer (name ("SelectBoxUtils.tolerantItemByVisibleText" ));
2727 private static final Timer tolerantItemByIndexAction = MetricRegistryHelper .get ().timer (name ("SelectBoxUtils.tolerantItemByIndex" ));
2828
29- public SelectBoxUtils (WebDriver webDriver ) {
30- super (webDriver );
31- }
32-
3329 /**
3430 * Selects an option that has a matching value attribute in the Options tag markup
3531 * @param selectBox active WebElement, already located
@@ -71,61 +67,58 @@ public static void itemByVisibleText(WebElement selectBox, String visibleText) {
7167 }
7268
7369 /**
74- * @param webDriver
7570 * @param webElement active WebElement, already located
7671 * @param htmlValue HTML value attribute
7772 * @param timeout time in seconds to keep trying
7873 * @throws Throwable any unhandled or un-tolerated exception
7974 */
80- public static void tolerantItemByHtmlValueAttribute (WebDriver webDriver , WebElement webElement , String htmlValue , int timeout )
75+ public static void tolerantItemByHtmlValueAttribute (WebElement webElement , String htmlValue , int timeout )
8176 throws Throwable {
8277 try (final Timer .Context ignored = tolerantItemByHtmlValueAttributeAction .time ()) {
83- new SelectBoxUtils (webDriver ).tolerantInteraction (
78+ new SelectBoxUtils ().tolerantInteraction (
8479 webElement , SelectBoxInteractionType .BY_VALUE , Optional .of (htmlValue ), Optional .empty (), timeout );
8580 }
8681 }
8782
8883 /**
89- * @param webDriver
9084 * @param webElement active WebElement, already located
9185 * @param htmlValue HTML value attribute
9286 * @throws Throwable any unhandled or un-tolerated exception
9387 */
94- public static void tolerantItemByHtmlValueAttribute (WebDriver webDriver , WebElement webElement , String htmlValue )
88+ public static void tolerantItemByHtmlValueAttribute (WebElement webElement , String htmlValue )
9589 throws Throwable {
9690 try (final Timer .Context ignored = tolerantItemByHtmlValueAttributeAction .time ()) {
97- new SelectBoxUtils (webDriver ).tolerantInteraction (
91+ new SelectBoxUtils ().tolerantInteraction (
9892 webElement , SelectBoxInteractionType .BY_VALUE , Optional .of (htmlValue ), Optional .empty (),
9993 TestConfigHelper .get ().getTolerantActionWaitTimeoutInSeconds ());
10094 }
10195 }
10296
10397 /**
104- * @param webDriver
10598 * @param webElement active WebElement, already located
10699 * @param visibleText visible text in the select box (NOT the HTML value attribute)
107100 * @param timeout time in seconds to keep trying
108101 * @throws Throwable any unhandled or un-tolerated exception
109102 */
110- public static void tolerantItemByVisibleText (WebDriver webDriver , WebElement webElement , String visibleText , int timeout )
103+ public static void tolerantItemByVisibleText (WebElement webElement , String visibleText , int timeout )
111104 throws Throwable {
112105 try (final Timer .Context ignored = tolerantItemByVisibleTextAction .time ()) {
113- new SelectBoxUtils (webDriver ).tolerantInteraction (
106+ new SelectBoxUtils ().tolerantInteraction (
114107 webElement , SelectBoxInteractionType .BY_VISIBLE_TEXT ,
115108 Optional .of (visibleText ), Optional .empty (), timeout );
116109 }
117110 }
118111
119112 /**
120- * @param webDriver
113+
121114 * @param webElement active WebElement, already located
122115 * @param visibleText visible text in the select box (NOT the HTML value attribute)
123116 * @throws Throwable any unhandled or un-tolerated exception
124117 */
125- public static void tolerantItemByVisibleText (WebDriver webDriver , WebElement webElement , String visibleText )
118+ public static void tolerantItemByVisibleText (WebElement webElement , String visibleText )
126119 throws Throwable {
127120 try (final Timer .Context ignored = tolerantItemByVisibleTextAction .time ()) {
128- new SelectBoxUtils (webDriver ).tolerantInteraction (
121+ new SelectBoxUtils ().tolerantInteraction (
129122 webElement , SelectBoxInteractionType .BY_VISIBLE_TEXT ,
130123 Optional .of (visibleText ), Optional .empty (),
131124 TestConfigHelper .get ().getTolerantActionWaitTimeoutInSeconds ());
@@ -141,36 +134,35 @@ public static void tolerantItemByVisibleText(WebDriver webDriver, WebElement web
141134 public static void tolerantItemByVisibleText (WebDriver webDriver , By locator , String visibleText )
142135 throws Throwable {
143136 try (final Timer .Context ignored = tolerantItemByVisibleTextAction .time ()) {
144- new SelectBoxUtils (webDriver ).tolerantInteraction (
137+ new SelectBoxUtils ().tolerantInteraction (
138+ webDriver ,
145139 locator , SelectBoxInteractionType .BY_VISIBLE_TEXT ,
146140 Optional .of (visibleText ), Optional .empty (),
147141 TestConfigHelper .get ().getTolerantActionWaitTimeoutInSeconds ());
148142 }
149143 }
150144
151145 /**
152- * @param webDriver
153146 * @param webElement active WebElement, already located
154147 * @param index index in order of display
155148 * @param timeout time in seconds to keep trying
156149 * @throws Throwable any unhandled or un-tolerated exception
157150 */
158- public static void tolerantItemByIndex (WebDriver webDriver , WebElement webElement , int index , int timeout ) throws Throwable {
151+ public static void tolerantItemByIndex (WebElement webElement , int index , int timeout ) throws Throwable {
159152 try (final Timer .Context ignored = tolerantItemByIndexAction .time ()) {
160- new SelectBoxUtils (webDriver ).tolerantInteraction (
153+ new SelectBoxUtils ().tolerantInteraction (
161154 webElement , SelectBoxInteractionType .BY_INDEX , Optional .empty (), Optional .of (index ), timeout );
162155 }
163156 }
164157
165158 /**
166- * @param webDriver
167159 * @param webElement active WebElement, already located
168160 * @param index index in order of display
169161 * @throws Throwable any unhandled or un-tolerated exception
170162 */
171- public static void tolerantItemByIndex (WebDriver webDriver , WebElement webElement , int index ) throws Throwable {
163+ public static void tolerantItemByIndex (WebElement webElement , int index ) throws Throwable {
172164 try (final Timer .Context ignored = tolerantItemByIndexAction .time ()) {
173- new SelectBoxUtils (webDriver ).tolerantInteraction (
165+ new SelectBoxUtils ().tolerantInteraction (
174166 webElement , SelectBoxInteractionType .BY_INDEX , Optional .empty (), Optional .of (index ),
175167 TestConfigHelper .get ().getTolerantActionWaitTimeoutInSeconds ());
176168 }
0 commit comments