Need Help on Iframes

54 views
Skip to first unread message

Balaji Singh .Y

unread,
Jun 7, 2016, 1:27:39 PM6/7/16
to seleniu...@googlegroups.com
Hi,

I am finding difficult to enter the user name and password  present on the iframe  which gets popped up when we click on the signin link.

Can somebody help me on this.

Site link given below 



With Regards, 
BALAJI SINGH .Y

⇜Krishnan Mahadevan⇝

unread,
Jun 7, 2016, 10:20:15 PM6/7/16
to Selenium Users
Balaji,

This should do the trick

public class CashKaroSample {
public static void main(String[] args) {
final String url = "http://cashkaro.iamsavings.co.uk/";
RemoteWebDriver driver = null;
try {
driver = new ChromeDriver();
driver.get(url);
driver.findElement(By.linkText("SIGN IN")).click();
WebDriverWait wait = new WebDriverWait(driver, 15);
String xpath = "//iframe[contains(@src,'http://cashkaro.iamsavings.co.uk/')]";
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.xpath(xpath)));
WebElement uname = driver.findElement(By.name("uname"));
System.err.println("****" + uname.getAttribute("onblur"));
} finally {
if (driver != null) {
driver.quit();
}
}
}
}

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
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/CAC1DipcV%3DrOF1f7%2BHr092G3ogTkhhAO%3D3x4fNPKNmGW-zKvpdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Lucas Tierney

unread,
Jun 7, 2016, 10:25:41 PM6/7/16
to Selenium Users, balaj...@gmail.com
Are you switching the context to the iFrame?

This worked fine for me:
  1. Click SIGN IN
  2. Wait for iFrame element
  3. Switch driver frame ti iFrame element
  4. Enter text into Email input 

Xiang Dong

unread,
Jun 7, 2016, 10:27:57 PM6/7/16
to seleniu...@googlegroups.com


I did a test on this link and it works well, which step do you have problem?  you can switch frame to "//*[@id='cboxLoadedContent']/IFRAME[1]", it is a xpath.

BTW, if you wants to input password, please us id="pwd-txt" instead of "pwd", otherwise, you will get invalidState exception.

Best Regards,
--david


From: seleniu...@googlegroups.com <seleniu...@googlegroups.com> on behalf of Balaji Singh .Y <bal...@gmail.com>
Sent: Wednesday, June 8, 2016 1:27 AM
To: seleniu...@googlegroups.com
Subject: [selenium-users] Need Help on Iframes
 
Hi,

I am finding difficult to enter the user name and password  present on the iframe  which gets popped up when we click on the signin link.

Can somebody help me on this.

Site link given below 

Get Coupons, Promo Codes & EXTRA Cashback Offers on India's Best Online Shopping sites like Flipkart, Amazon, Myntra, Jabong, Snapdeal & more. Join Free!



With Regards, 
BALAJI SINGH .Y

--

Balaji Singh .Y

unread,
Jun 10, 2016, 3:16:29 AM6/10/16
to seleniu...@googlegroups.com
Thanks a lot for everyone who helped in providing the solutions.


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



--
BALAJI SINGH .Y

Balaji Singh .Y

unread,
Jun 10, 2016, 3:17:24 AM6/10/16
to seleniu...@googlegroups.com
Thanks a lot Krishna for your time and providing solution.


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



--
BALAJI SINGH .Y
Reply all
Reply to author
Forward
0 new messages