@@ -93,7 +93,7 @@ public <T extends IElement> List<T> findElements(By locator, String name, IEleme
93
93
for (int index = 1 ; index <= webElements .size (); index ++) {
94
94
WebElement webElement = webElements .get (index - 1 );
95
95
String currentName = String .format ("%1$s %2$s" , namePrefix , index );
96
- T element = supplier .get (generateXpathLocator (locator , webElement , index ), currentName , state );
96
+ T element = supplier .get (generateLocator (locator , webElement , index ), currentName , state );
97
97
list .add (element );
98
98
}
99
99
return list ;
@@ -126,6 +126,18 @@ public <T extends IElement> List<T> findElements(By locator, String name, Class<
126
126
return findElements (locator , name , elementSupplier , count , state );
127
127
}
128
128
129
+ /**
130
+ * Generates locator for target element.
131
+ *
132
+ * @param multipleElementsLocator locator used to find elements.
133
+ * @param webElement target element.
134
+ * @param elementIndex index of target element.
135
+ * @return target element's locator
136
+ */
137
+ protected By generateLocator (By multipleElementsLocator , WebElement webElement , int elementIndex ) {
138
+ return generateXpathLocator (multipleElementsLocator , webElement , elementIndex );
139
+ }
140
+
129
141
/**
130
142
* Generates xpath locator for target element.
131
143
*
0 commit comments