<html><head></head><frameset cols="5,*" border="0" frameborder="no" framespacing="0"><frameset rows="145,*" border="0" frameborder="no" framespacing="0"><frame name="kalender" src="../calendar/Month.jsp" marginwidth="0" marginheight="0" noresize="" scrolling="no"><frame name="dagskalender" src="../calendar/NewTimeReg.jsp" marginwidth="10" marginheight="20" noresize="" scrolling="no"></frameset><frameset rows="50,*,1" border="0" frameborder="NO" framespacing="0"><frameset cols="63,175,*,35" border="0" frameborder="NO" framespacing="0"><frame name="dagbund" src="Mail.jsp" marginwidth="0" marginheight="0" noresize="" scrolling="NO"><frame name="soeg" src="../search/main/Cont.jsp" marginwidth="0" marginheight="0" noresize="" scrolling="no"><frame name="topbar" src="TopBarMid.jsp" marginwidth="0" marginheight="0" noresize="" scrolling="no"><frame name="topbarende" src="TopBarRight.jsp" marginwidth="0" marginheight="0" noresize="" scrolling="no"></frameset><frame name="main" src="../startpage/Fram.jsp?null" marginwidth="0" marginheight="0" noresize=""><frameset cols="33%,33%,33%,*" border="0" frameborder="NO" framespacing="0"><frame name="skjult" src="Blank.jsp" marginwidth="0" marginheight="0" noresize="" scrolling="no"><frame name="skjult2" src="Blank2.jsp" marginwidth="0" marginheight="0" noresize="" scrolling="no"><frame name="skjult3" src="Blank3.jsp" marginwidth="0" marginheight="0" noresize="" scrolling="no"><frame name="AppletLoader" src="" marginwidth="0" marginheight="0" noresize="" scrolling="no"></frameset></frameset></frameset></html>
getDriver().switchTo().defaultContent();String SAML = System.getProperty("login.user.saml").toString();if(SAML.equalsIgnoreCase("false")) // some sites have an extra parent frame{staticlogger.info( "Switching to 'system' frame..." );getDriver().switchTo().frame("system"); //disable step if SAML-login}staticlogger.info( "Switching to 'main' frame..." );getDriver().switchTo().frame("main");staticlogger.info( "Done switching to 'main' frame..." );
List<WebElement> ele = getDriver().findElements(By.tagName("frame"));
for(WebElement el : ele)
{
staticlogger.info( "Frame: " + el.getAttribute("name") + " ID: " + el.getAttribute("id"));
if(el.getAttribute("name").equalsIgnoreCase("main"))
{
staticlogger.info( "Switching to 'main' frame..." );
getDriver().switchTo().frame(el);
}
net.serenitybdd.core.exceptions.SerenityManagedException: Element belongs to a different frame than the current one - switch to its containing frame to use itCommand duration or timeout: 15.11 secondsFor documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.htmlBuild info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'System info: host: 'xx', ip: '10.xxx.xxx.xx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.1.2.el7.x86_64', java.version: '1.8.0_66'Driver info: org.openqa.selenium.firefox.FirefoxDriverCapabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=46.0.1, platform=LINUX, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]Session ID: bc102c91-ffac-41a4-aa1f-633067acddfbat net.serenitybdd.core.exceptions.SerenityManagedException.detachedCopyOf(SerenityManagedException.java:20)at net.thucydides.core.steps.StepInterceptor.reportMethodError(StepInterceptor.java:281)at net.thucydides.core.steps.NormalMethodRunner.invokeMethodAndNotifyFailures(NormalMethodRunner.java:22)at net.thucydides.core.steps.StepInterceptor.runNormalMethod(StepInterceptor.java:269)at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:127)at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:61)at org.TeamOnline.jbehave.steps.ResponseTimesUserSteps$$EnhancerByCGLIB$$2b7019e.chooses_last_3_days(<generated>)at org.TeamOnline.jbehave.definitions.ResponseTimesDefinitionSteps.givenTheUserFiltersFor3DaysAndTitle(ResponseTimesDefinitionSteps.java:83)(reflection-invoke)at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:599)at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:340)
String SAML = System.getProperty("login.user.saml").toString();
getDriver().switchTo().defaultContent();if(SAML.equalsIgnoreCase("false"))
{staticlogger.info( "Switching to 'system' frame..." );getDriver().switchTo().frame("system"); //disable step if SAML-login}staticlogger.info( "Switching to 'main' frame..." );
getDriver().manage().timeouts().implicitlyWait( 2, TimeUnit.SECONDS );try{getDriver().switchTo().frame("main");}catch ( StaleElementReferenceException ser ){staticlogger.info( "WARNING: Stale 'main' frame");}catch ( NoSuchFrameException nsf ){staticlogger.info( "ERROR: No 'main' frame found");} catch ( Exception e ){staticlogger.info( "ERROR: " + e.getMessage() );}getDriver().manage().timeouts().implicitlyWait( DEFAULT_IMPLICIT_WAIT, TimeUnit.SECONDS );
staticlogger.info( "Done switching to 'main' frame..." );
long startTime = System.currentTimeMillis();driver.manage().timeouts().implicitlyWait( 250, TimeUnit.MILLISECONDS );WebElement we = null;boolean unfound = true;int tries = 0;while ( unfound && tries < 8 ) {tries += 1;try {we = driver.findElement( locator );unfound = false; // FOUND IT} catch ( StaleElementReferenceException ser ) {staticlogger.info( "Try [" + tries + "] - ERROR: Stale element. " + locator.toString() );unfound = true;} catch ( NoSuchElementException nse ) {staticlogger.info( "Try [" + tries + "] - ERROR: No such element. " + locator.toString() );unfound = true;} catch ( Exception e ) {staticlogger.info( "Try [" + tries + "] - " + e.getMessage() );}}long endTime = System.currentTimeMillis();long totalTime = endTime - startTime;if (we != null)staticlogger.info("Try [" + tries + "] - Found element after " + totalTime + " milliseconds.");elsestaticlogger.info("Element NOT found after looking for " + totalTime + " milliseconds.");driver.manage().timeouts().implicitlyWait( DEFAULT_IMPLICIT_WAIT, TimeUnit.SECONDS );return we;