Unable click signup button in iframe popup window.

167 views
Skip to first unread message

kot bangalore

unread,
May 5, 2014, 6:08:30 AM5/5/14
to
Hi All 

unable click signup button in iframe popup window.
I request you all please help me to implement this scenario.

i have tried this code also
, but i dont have luck so far 

       driver.switchTo().frame(driver.findElement(By.xpath(".//*[@id='modal-my-capella']")));
AND
        driver.switchTo().defaultContent();


requesting please refer screen schoot1 and screen schoot2
Screen Shot 2.png
Screen Shot.png

Shawn McCarthy

unread,
May 5, 2014, 12:03:17 PM5/5/14
to seleniu...@googlegroups.com
Have you tried to switchTo the frame by using the IFrame locator instead of the above div ?
driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[src*='/mycapella/login/?src=Header']")));

Afzal

unread,
May 6, 2014, 2:49:59 AM5/6/14
to seleniu...@googlegroups.com
Hi

I have tried with below code and it is throwing exception, an luck from your end

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

/**
 * @author afzals
 *
 */
public class IFramehandler {

/**
* @param args
*/
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.capella.edu/");
driver.manage().timeouts().implicitlyWait(4500, TimeUnit.SECONDS);
driver.findElement(By.xpath("//span[@class='icons icon-arrow']")).click();
driver.findElement(By.xpath("//div[@id='login-dropdown']/div/ul/li/a[@class='modal-mc-window']")).click();
driver.switchTo().frame(driver.findElement(By.xpath(".//*[@id='modal-my-capella']")));
driver.findElement(By.id("Email")).sendKeys("te...@test.com");
driver.switchTo().defaultContent();

}

}

====================
Exception :: 
=======================

Exception in thread "main" org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: Element cannot be scrolled into view:http://www.capella.edu/mycapella/login/?src=Header
Command duration or timeout: 22 milliseconds
Build info: version: '2.41.0', revision: '3192d8a6c4449dc285928ba024779344f5423c58', time: '2014-03-27 11:29:39'
System info: host: 'HL-AFZALS', ip: '10.69.32.64', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_45'
Session ID: 237340f6-a484-42aa-894b-b3aae6b3cd96
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, browserConnectionEnabled=true, webStorageEnabled=true, nativeEvents=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=28.0}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:79)
at com.yoyo.selenium.testngproject.tests.IFramehandler.main(IFramehandler.java:27)
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Element cannot be scrolled into view:http://www.capella.edu/mycapella/login/?src=Header
Build info: version: '2.41.0', revision: '3192d8a6c4449dc285928ba024779344f5423c58', time: '2014-03-27 11:29:39'
System info: host: 'HL-AFZALS', ip: '10.69.32.64', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_45'


==================================================================================================================

Hub

unread,
May 6, 2014, 3:21:59 AM5/6/14
to seleniu...@googlegroups.com
Try with 

driver.switchTo().frame(driver.findElement(By.xpath("//div[@id='modal-my-capella']/iframe")));

On Monday, May 5, 2014 3:38:30 PM UTC+5:30, kotresh gt wrote:

santhosh soma

unread,
May 6, 2014, 12:35:38 PM5/6/14
to seleniu...@googlegroups.com
Hi,

Can you please try with below once.

  driver.switchTo().frame(driver.findElement(By.xpath(//iframe[contains(@src,'login')])).

Thanks
Santhosh.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/aee8cf23-4e56-4636-ba8b-e29fe452b7fd%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

kot bangalore

unread,
May 7, 2014, 7:01:56 AM5/7/14
to seleniu...@googlegroups.com
Thank you so much for all your quick response, this is really much appreciated
script running without any issues , i used this piece of code,  driver.switchTo().frame(2);


Reply all
Reply to author
Forward
0 new messages