Skip to content

Commit 61cc97a

Browse files
mialeskapaveliam
authored andcommitted
add InvalidElementStateException handling to ElementActionRetrier to resolve #80 (#82)
1 parent 105381f commit 61cc97a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Aquality.Selenium/src/Aquality.Selenium/Utilities/ElementActionRetrier.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
namespace Aquality.Selenium.Utilities
77
{
88
/// <summary>
9-
/// Retries an action or function when <see cref="StaleElementReferenceException"/> occures.
9+
/// Retries an action or function when <see cref="StaleElementReferenceException"/> or <see cref="InvalidElementStateException"/> occures.
1010
/// </summary>
1111
internal sealed class ElementActionRetrier
1212
{
1313
/// <summary>
14-
/// Retries the action when <see cref="StaleElementReferenceException"/> occures.
14+
/// Retries the action when <see cref="StaleElementReferenceException"/> or <see cref="InvalidElementStateException"/> occures.
1515
/// </summary>
1616
/// <param name="action">Action to be applied.</param>
1717
public static void DoWithRetry(Action action)
@@ -24,7 +24,7 @@ public static void DoWithRetry(Action action)
2424
}
2525

2626
/// <summary>
27-
/// Retries the function when <see cref="StaleElementReferenceException"/> occures.
27+
/// Retries the function when <see cref="StaleElementReferenceException"/> or <see cref="InvalidElementStateException"/> occures.
2828
/// </summary>
2929
/// <typeparam name="T">Return type of function.</typeparam>
3030
/// <param name="function">Function to be applied.</param>
@@ -61,7 +61,7 @@ public static T DoWithRetry<T>(Func<T> function)
6161

6262
private static bool IsExceptionHandled(Exception exception)
6363
{
64-
return exception is StaleElementReferenceException;
64+
return exception is StaleElementReferenceException || exception is InvalidElementStateException;
6565
}
6666
}
6767
}

0 commit comments

Comments
 (0)