withFrame($("#firstFrame")) { withFrame($("#secondFrame")) { withFrame($("#thirdFrame")) { assert { $("#email").displayed } } } }
--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/88a389b1-b6c9-4d72-8140-4efc00e7e5c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
org.openqa.selenium.NoSuchFrameException: No elements for given content: []Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'System info: host: 'MacBook-Pro-2.local', ip: '2601:602:9701:1a30:4d40:10a1:f9ec:5ada', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.3', java.version: '1.8.0_131'Driver info: driver.version: unknown
at geb.frame.DefaultFrameSupport.executeWithFrame(DefaultFrameSupport.groovy:79) at geb.frame.DefaultFrameSupport.withFrame(DefaultFrameSupport.groovy:44) at geb.Page.withFrame(Page.groovy:120) at pages.googleDocs.DocumentPage.loginToRefWorks_closure8(DocumentPage.groovy:77) at pages.googleDocs.DocumentPage.loginToRefWorks_closure8(DocumentPage.groovy) at geb.frame.DefaultFrameSupport.executeWithFrame(DefaultFrameSupport.groovy:69) at geb.frame.DefaultFrameSupport.executeWithFrame(DefaultFrameSupport.groovy:81) at geb.frame.DefaultFrameSupport.withFrame(DefaultFrameSupport.groovy:44) at geb.Page.withFrame(Page.groovy:120) at pages.googleDocs.DocumentPage.loginToRefWorks(DocumentPage.groovy:76) at geb.Browser.methodMissing(Browser.groovy:209) at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56) at specs.references.CanSearchReferencesSpec.User can select RefWorks add-on(CanSearchReferencesSpec.groovy:18)
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/20a49c28-c4e2-4931-a1d0-29d3ad304c54%40googlegroups.com.
Thanks Marcin. I tried doing exactly that, and still couldn't get things to work, so I tried the same workflow with the Java version of the Selenium WebDriver.This works as expected with the Java selenium-api:
driver.switchTo().frame(8);
driver.switchTo().frame("sandboxFrame");
driver.switchTo().frame("userHtmlFrame");
driver.findElement(By.id("email")).sendKeys(username);
driver.findElement(By.id("password")).sendKeys(password);
...but an equivalent workflow using Geb throws a NoSuchFrameException:
withFrame(8) {
withFrame('sandboxFrame') {
withFrame('userHtmlFrame') {
$('#email').value(username)
$('#password').value(password)
}
}
}
The complete exception message is:
org.openqa.selenium.NoSuchFrameException: No frame element found by name or id sandboxFrame
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'C02P10DNG3QC.local', ip: '2601:602:9701:1a30:24ff:4dc1:ac2:3b96', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.3', java.version: '1.8.0_91'Driver info: driver.version: unknownat org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.frame(RemoteWebDriver.java:884)at geb.frame.DefaultFrameSupport.executeWithFrame(DefaultFrameSupport.groovy:57)at geb.frame.DefaultFrameSupport.withFrame(DefaultFrameSupport.groovy:36)at geb.Page.withFrame(Page.groovy:120)at pages.googleDocs.DocumentPage.loginToRefWorks_closure7(DocumentPage.groovy:76)at pages.googleDocs.DocumentPage.loginToRefWorks_closure7(DocumentPage.groovy)at geb.frame.DefaultFrameSupport.executeWithFrame(DefaultFrameSupport.groovy:69)at geb.frame.DefaultFrameSupport.withFrame(DefaultFrameSupport.groovy:36)at geb.Page.withFrame(Page.groovy:120)at pages.googleDocs.DocumentPage.loginToRefWorks(DocumentPage.groovy:75)
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/20a49c28-c4e2-4931-a1d0-29d3ad304c54%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/fcf66a0a-5ffe-48d3-8098-41fbd4b385b1%40googlegroups.com.
import geb.Page
class YouarPageWithIFramesPage extends Page {
static at = { contentFrame.size() > 0 }
static content = {
contentFrame(page: FrameDescribingPage, wait: true) { $("iframe[id='MyIframe']") }
}
/**
* Method to interact with Iframe.
*/
def MethodToInteractWithIframe(String user, String password) {
withFrame(contentFrame)
{
waitFor{$("input#Login").isDisplayed()}
$("input#Login").value user
$("input#Password").value password
$("button#submit").click()
}
}
}
/**
* model class for page that describes the iframe
*/
class FrameDescribingPage extends Page {
static content = {
}
}
To unsubscribe from this group and stop receiving emails from it, send an email to geb-...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
void inputCreditCardDetails(
String cardNumber,
String expiryDate,
String holderName,
String cvv) {
withFrame(cardNumberIframe) {
cardNumberInput << cardNumber
}
// Not sure why we need this extra frame switching here...
driver.switchTo().frame($('.checkout-modal-iframe').firstElement())
expiryDateInput << expiryDate
holderNameInput << holderName
withFrame(cvvInputIframe) {
cvvInput << cvv
}
// Not sure why we need this extra frame switching here...
driver.switchTo().frame($('.checkout-modal-iframe').firstElement())
}
--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/665a6164-5146-47d8-8ce0-59dd3aa22891%40googlegroups.com.