webdriverio / webdriverio

Next-gen browser and mobile automation test framework for Node.js
http://webdriver.io
MIT License
9.06k stars 2.51k forks source link

Unable to switch between frames #433

Closed poorvikamahesh closed 9 years ago

poorvikamahesh commented 9 years ago

After hovering over a particular element, a new frame is loaded.

The iframe tag is as below -

<div class="login_iframe_placement">

<iframe class="login_iframe" frameborder="0" src="https://dev12-lora-loreal.demandware.net/on/demandware.store/Sites-Lora-Site/en_US/Login-UtilityLogin?source=popup&protocol=http" allowtransparency="true" scrolling="no">
<!DOCTYPE html>
\<html id="login-utilitylogin-page" class="js no-mobile desktop no-ie ff ff31 on-section demandware.store-section sites-lora-site-section en_us-section gradient rgba opacity textshadow multiplebgs boxshadow borderimage borderradius no-cssreflections csstransforms csstransitions no-touch no-retina fontface notAuthenticatedUser ext-strict domloaded w-630 gt-240 gt-320 gt-480 lt-640 lt-768 lt-800 lt-1024 lt-1280 lt-1440 lt-1680 lt-1920 no-portrait landscape" lang="en">
<head>

The code I am using to switch to frame is as below

client.addCommand("SwitchToFrame", function (frameEle,cb){
                  this.frame(frameEle, function (err,res){
                             console.log('Successfully Switched frames!!');
                             }).call(cb);
                  });

client.SwitchToFrame(".login_iframe");

But I am getting a NoSuchFrame exception.

Please help!!

christian-bromann commented 9 years ago

There are three options you can take to switch to a frame:

christian-bromann commented 9 years ago

Closing due to inactivity. Feel free to reopen this issue if you still have problems ;-)