Display results as :

Rechercher Advanced Search

Latest topics
» Selenium WebDriver Integration
Tue Nov 21, 2017 1:06 pm by azharuddin

» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce


driver.switchTo().defaultContent(); returning error when using latest version of Chrome

View previous topic View next topic Go down

driver.switchTo().defaultContent(); returning error when using latest version of Chrome

Post by BarryMcDermott on Wed Jun 10, 2015 6:26 pm

I'm running a regression pack for an online app using Chrome Driver on Version 42.0.2311.90 m of Google Chrome, and am having issues when trying to return focus from an iFrame back to the main screen, i.e. upon hitting the line of code 

This worked perfectly on earlier versions of Chrome, and still works fine on a colleagues pc which has Version 39.x.etc

Has anyone else encountered anything similar ?  If so, any help / advice / workaround would be greatly appreciated.

The code for the particular Java method is:

@When("I click the $buttonText button in AllFinanz")
public void clickButtonInAllFinanz(String buttonText) throws InterruptedException {
     System.out.println("[TEST] Clicking " + buttonText);
     try {
          // access inside iframe
          WebElement elementFrame = driver.findElement(By.xpath("//iframe[contains(@onload, 'riskAssessmentIframe')]"));

           // click the button
           WebElement button = driver.findElement(By.xpath("//input[@value='" + buttonText + "']"));

           // return focus to main window

           System.out.println("[SUCCESS] Clicked button " + buttonText);

     } catch (org.openqa.selenium.NoSuchElementException e) {
          System.out.println("[FAILURE] Unable to click button " + buttonText);
     } catch (org.openqa.selenium.ElementNotVisibleException e) {
          System.out.println("[FAILURE] " + buttonText + " not visible");

As stated all works fine up until the driver.switchTo().defaultContent(); line of code, where the following error is thrown back:
org.openqa.selenium.WebDriverException: unknown error: missing 'id' (Session info: chrome=42.0.2311.90) (Driver info: chromedriver=2.10.267521,platform=Windows NT 5.1 SP3 x86) (WARNING: The server did not provide any stacktrace information) System info: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.7.0_45' Driver info: driver.version: RemoteWebDriver

Again any help would be appreciated - I've ran out of ideas re workarounds and cant find any answers when googling.



Posts : 1
Join date : 2015-06-10

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum