File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1596,7 +1596,7 @@ private void DispatchToFormCore(DispatchToForm dispatch)
1596
1596
if ( ! dispatch . FormIsEnhanced )
1597
1597
{
1598
1598
// Verify the same form element is *not* still in the page
1599
- Assert . Throws < StaleElementReferenceException > ( ( ) => form . GetAttribute ( "method" ) ) ;
1599
+ Browser . True ( ( ) => IsElementStale ( form ) ) ;
1600
1600
}
1601
1601
else if ( ! dispatch . SuppressEnhancedNavigation )
1602
1602
{
@@ -1648,6 +1648,19 @@ private void GoTo(string relativePath)
1648
1648
Navigate ( $ "{ ServerPathBase } /{ relativePath } ") ;
1649
1649
}
1650
1650
1651
+ private static bool IsElementStale ( IWebElement element )
1652
+ {
1653
+ try
1654
+ {
1655
+ _ = element . Enabled ;
1656
+ return false ;
1657
+ }
1658
+ catch ( StaleElementReferenceException )
1659
+ {
1660
+ return true ;
1661
+ }
1662
+ }
1663
+
1651
1664
private struct TempFile
1652
1665
{
1653
1666
public string Name { get ; }
You can’t perform that action at this time.
0 commit comments