66using Aquality . Selenium . Browsers ;
77using Aquality . Selenium . Configurations ;
88using Aquality . Selenium . Core . Localization ;
9+ using Aquality . Selenium . Core . Utilities ;
910using Aquality . Selenium . Elements . Interfaces ;
1011
1112namespace Aquality . Selenium . Elements . Actions
@@ -29,6 +30,8 @@ public JsActions(IElement element, string elementType, ILocalizedLogger logger,
2930
3031 private Browser Browser => AqualityServices . Browser ;
3132
33+ private IElementActionRetrier ActionRetrier => AqualityServices . Get < IElementActionRetrier > ( ) ;
34+
3235 protected ILocalizedLogger Logger { get ; }
3336
3437 /// <summary>
@@ -157,18 +160,20 @@ public string GetXPath()
157160 /// <returns>Point object.</returns>
158161 public Point GetViewPortCoordinates ( )
159162 {
160- var coordinates = ExecuteScript < IList < object > > ( JavaScript . GetViewPortCoordinates ) . Select ( item => double . Parse ( item . ToString ( ) ) ) . ToArray ( ) ;
163+ var coordinates = ExecuteScript < IList < object > > ( JavaScript . GetViewPortCoordinates )
164+ . Select ( item => double . Parse ( item . ToString ( ) ) )
165+ . ToArray ( ) ;
161166 return new Point ( ( int ) Math . Round ( coordinates [ 0 ] ) , ( int ) Math . Round ( coordinates [ 1 ] ) ) ;
162167 }
163168
164169 protected T ExecuteScript < T > ( JavaScript scriptName , params object [ ] arguments )
165170 {
166- return Browser . ExecuteScript < T > ( scriptName , ResolveArguments ( arguments ) ) ;
171+ return ActionRetrier . DoWithRetry ( ( ) => Browser . ExecuteScript < T > ( scriptName , ResolveArguments ( arguments ) ) ) ;
167172 }
168173
169174 protected void ExecuteScript ( JavaScript scriptName , params object [ ] arguments )
170175 {
171- Browser . ExecuteScript ( scriptName , ResolveArguments ( arguments ) ) ;
176+ ActionRetrier . DoWithRetry ( ( ) => Browser . ExecuteScript ( scriptName , ResolveArguments ( arguments ) ) ) ;
172177 }
173178
174179 protected internal void LogElementAction ( string messageKey , params object [ ] args )
0 commit comments