2

I'm new to Webdriver. I need to automate a scenario on Mozilla,
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_27'

I have a scenario to create a user and login with the user created. So when I login with the user created, upon login a iframe - modal dialog box displayed asking for the user to change the temporary password.

I'm not able to manipulate the webelements in the Dialog Box. Its always says "Unable to locate element".

I have used:

driver.switchTo().defaultContent();

to switch to the Dialog box.

3

I use the following code to switch to an iFrame that's embedded in my HTML, although I am unsure if it will help in your dialogue box:

driver.switchTo().frame(0);
        WebElement webelement= driver.switchTo().activeElement();
        ((JavascriptExecutor) driver).executeScript("document.body.innerHTML = '<br>'");
        //do whatever with weblement in here
        driver.switchTo().defaultContent(); //switches focus out of iFrame
  • You can also switch to a frame by name. – Sam Woods Oct 23 '12 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.