Buggy code:
public abstract class AbstractElementFind extends AbstractTestObjectFinderImpl { private String findByValue ; @ Nullable private IOnTheFlyData < Integer > indexOfSameElements ; @ Nullable protected transient Wait < WebDriver > wait ; public Wait < WebDriver > getWait ( ) { } public abstract WebElement doFind ( IMyWebDriver myWebDriver , String findByValue ) { } public AbstractElementFind ( String findByValue ) { } public String getFindByValue ( ) { } public void setFindByValue ( final String findByValue ) { } public boolean supports ( final String arg0 ) { } public void createWait ( WebDriver driver ) { } @ Override @ Nullable public < T > T getCapability ( Class < T > type ) { } public WebElement doFind ( IMyWebDriver myWebDriver ) throws NoSuchElementException { } public int getIndexOfSameElementsInt ( ) { } public IOnTheFlyData < Integer > getIndexOfSameElements ( ) { } public void setIndexOfSameElements ( IOnTheFlyData < Integer > indexOfSameElements ) { } @ Nullable protected WebElement findThroughFrames ( BrowserWindow win , WindowFrame winFrame , Wait < WebDriver > wait , final By findByValue ) { } protected WebElement findElement ( final By findBy , IMyWebDriver myWebDriver ) { WebDriver webD = myWebDriver . getWebDriver ( ) ; if ( null == webD ) { throw new IllegalStateException ( "web<seq2seq4repair_space>driver<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>correctly<seq2seq4repair_space>populated." ) ; } else { createWait ( webD ) ; BrowserWindow winOnFocus = myWebDriver . getMultiWindowsHandler ( ) . getBrowserWindowOnFocus ( ) ; winOnFocus . switchToDefaultContent ( ) ; if ( ! ( winOnFocus . getLastSuccessElementFindFrameChain ( ) . isEmpty ( ) ) ) { for ( WindowFrame lastSuccessWFrame : winOnFocus . getLastSuccessElementFindFrameChain ( ) ) { lastSuccessWFrame . obtainFrameFocus ( ) ; } } WebElement retValWE = null ; try { retValWE = getWait ( ) . until ( new Function < WebDriver , WebElement > ( ) { @ Nullable public WebElement apply ( @ Nullable WebDriver driver ) { if ( null == driver ) { throw new IllegalStateException ( "webdriver<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>correctly<seq2seq4repair_space>populated." ) ; } else { List < WebElement > allElements = driver . findElements ( findBy ) ; if ( ( allElements . size ( ) ) == 0 ) throw new NoSuchElementException ( findByValue ) ; WebElement retVal ; int intIndex = getIndexOfSameElementsInt ( ) ; if ( intIndex < ( - 1 ) ) { retVal = allElements . get ( 0 ) ; } else if ( intIndex == ( - 1 ) ) { retVal = allElements . get ( ( ( allElements . size ( ) ) - 1 ) ) ; } else { retVal = allElements . get ( intIndex ) ; } return retVal ; } } } ) ; } catch ( NoSuchElementException | TimeoutException error ) { winOnFocus . getCurrentElementFindFrameChain ( ) . clear ( ) ; <START_BUG> for ( WindowFrame winfr : winOnFocus . getFrames ( ) ) { <END_BUG> try { if ( null == winfr ) throw GlobalUtils . createInternalError ( "arraylist<seq2seq4repair_space>error" , error ) ; winfr . focusDefautContent ( ) ; retValWE = findThroughFrames ( winOnFocus , winfr , getWait ( ) , findBy ) ; if ( null == retValWE ) winfr . focusDefautContent ( ) ; else { break ; } } catch ( NoSuchElementException | TimeoutException error1 ) { continue ; } } } if ( null != retValWE ) { return retValWE ; } throw new NoSuchElementException ( findBy . toString ( ) ) ; } } }

Fix:
for ( WindowFrame winfr : winOnFocus . getVisibleFrames ( ) ) {