@@ -42,6 +42,7 @@ class AppiumElementLocator implements CacheableLocator {
42
42
final boolean shouldCache ;
43
43
final By by ;
44
44
final TimeOutDuration timeOutDuration ;
45
+ private final TimeOutDuration originalTimeOutDuration ;
45
46
final WebDriver originalWebDriver ;
46
47
private final SearchContext searchContext ;
47
48
private final WaitingFunction waitingFunction ;
@@ -56,16 +57,18 @@ class AppiumElementLocator implements CacheableLocator {
56
57
* @param by a By locator strategy
57
58
* @param shouldCache is the flag that signalizes that elements which
58
59
* are found once should be cached
59
- * @param duration is a POJO which contains timeout parameters
60
+ * @param duration is a POJO which contains timeout parameters for the element to be searched
61
+ * @param originalDuration is a POJO which contains timeout parameters from page object which contains the element
60
62
* @param originalWebDriver is an instance of WebDriver that is going to be
61
63
* used by a proxied element
62
64
*/
63
65
64
66
public AppiumElementLocator (SearchContext searchContext , By by , boolean shouldCache ,
65
- TimeOutDuration duration , WebDriver originalWebDriver ) {
67
+ TimeOutDuration duration , TimeOutDuration originalDuration , WebDriver originalWebDriver ) {
66
68
this .searchContext = searchContext ;
67
69
this .shouldCache = shouldCache ;
68
70
this .timeOutDuration = duration ;
71
+ this .originalTimeOutDuration = originalDuration ;
69
72
this .by = by ;
70
73
this .originalWebDriver = originalWebDriver ;
71
74
waitingFunction = new WaitingFunction (this .searchContext );
@@ -89,7 +92,7 @@ private List<WebElement> waitFor() {
89
92
} catch (TimeoutException e ) {
90
93
return new ArrayList <>();
91
94
} finally {
92
- changeImplicitlyWaitTimeOut (timeOutDuration .getTime (), timeOutDuration .getTimeUnit ());
95
+ changeImplicitlyWaitTimeOut (originalTimeOutDuration .getTime (), originalTimeOutDuration .getTimeUnit ());
93
96
}
94
97
}
95
98
0 commit comments