So I believe Mailinator made a change over the weekend and a bunch of tests I had developed which Send emails out of an app we’re testing (and then flip into a mailinator inbox to verify that the email arrives, and then, at times, verify and grab text information presented in the email body).
Now, traditionally text in the mailinator email body is contained within an iFrame and I have an object that defines that iFrame and use the WebUI.switchToFrame to get into that email body at which point using objects to WebUI.GetText on has been pretty straightforward, however, some time between Friday Sept 4 and Sunday Sept 6 evening, all those steps are failing with the following error:
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to get text of object ‘Object Repository/Data/Audit Trail/Mailinator/Email Text’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.GetTextKeyword.getText(GetTextKeyword.groovy:88)
at com.kms.katalon.core.webui.keyword.builtin.GetTextKeyword.execute(GetTextKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.getText(WebUiBuiltInKeywords.groovy:888)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$getText$8.call(Unknown Source)
at Verify Audit Trail List can be Exported.run(Verify Audit Trail List can be Exported:87)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1599514344398.run(TempTestCase1599514344398.groovy:23)
Caused by: org.openqa.selenium.JavascriptException: javascript error: Cannot read property ‘clientWidth’ of null
(Session info: chrome=85.0.4183.83)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-19G24CPJ’, ip: ‘192.168.0.15’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 85.0.4183.83, chrome: {chromedriverVersion: 85.0.4183.38 (9047dbc2c693f…, userDataDir: C:\Users\jef\AppData\Local…}, goog:chromeOptions: {debuggerAddress: localhost:53422}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: 97e2ff2d3241227ee6d64c0ce5bdfa87
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:19)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
at org.openqa.selenium.remote.RemoteWebElement.getText(RemoteWebElement.java:166)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.lambda$new$0(EventFiringWebDriver.java:404)
at com.sun.proxy.$Proxy10.getText(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.getText(EventFiringWebDriver.java:463)
at com.kms.katalon.core.webui.keyword.builtin.GetTextKeyword$_getText_closure1.doCall(GetTextKeyword.groovy:80)
at com.kms.katalon.core.webui.keyword.builtin.GetTextKeyword$_getText_closure1.call(GetTextKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
… 17 more
In short, it looks like it’s not there and/or if it is it has a clientWidth of “null”
I double checked the object used for the Mailinator email body for the switch to Frame statement and it looks like it’s still correct:
//iframe[@id = ‘msg_body’ and @title = ‘Email Message Body’ and @name = ‘msg_body’ and (text() = ’
EMAIL BODY
’ or . = ’
EMAIL BODY
')]
Here’s a sample of a mailinator inbox that could be looked at (to put an email in it you’d have to send an email to audittrailexport@mailinator.com:
https://www.mailinator.com/v3/index.jsp?zone=public&query=audittrailexport#/#inboxpane
Once you open the email it looks like the normal iFrame for email body is present, but attempting to grab any text out of it is giving the error above.
sometimes text is in a
.
I’ve tried using the object Spy to see if I can get a better description of the iFrame object OR objects within the iFrame - same issues
I’ve tried not switching to the iFrame and just seeing if I can Get the text from within the page (Maybe they removed the iFrame? - that doesn’t work
I’ve tried making slight tweaks to the iFrame object - no help so far
I’ve tried using the WebUI.GetAttribute command, but as the text appears to be loose in
s there is no attribute I see to be able to attach to the object to get stuff when I am in the iFrame.
Interestingly, when I am in FireFox, and in Mailinator on a message, can right click and see that there is a Frame present that it detects, but when I attempt to open the Frame in it’s own tab or window I just get a completely blank page.
Uncertain what changed about mailinator over the weekend that has made getting text out of it’s email bodies so hard to pick up.
Has anyone had any issues getting text out of an iFrame before and what, if anything has worked?
Here is a sample snippet of my TC code that attempts to access the Mailinator inbox and grab some text from something that is throwing the error above:
WebUI.navigateToUrl(‘https://www.mailinator.com/v3/index.jsp?zone=public&query=methodaudittrailexport#/#inboxpane’)
WebUI.delay(3)
WebUI.click(findTestObject(‘Data/Audit Trail/Mailinator/First Email’))
WebUI.delay(3)
‘verify email is recieved and contains correct info’
WebUI.scrollToElement(findTestObject(‘Data/Audit Trail/Mailinator/Email Body’), 0)
WebUI.delay(1)
WebUI.switchToFrame(findTestObject(‘Page_Mailinator Main Site/iframe_EMAIL BODY’), 0)
‘download audit trail list’
WebUI.verifyElementPresent(findTestObject(‘Data/Audit Trail/Mailinator/Button_DownloadExport’), 0)
WebUI.verifyElementClickable(findTestObject(‘Data/Audit Trail/Mailinator/Button_DownloadExport’))
WebUI.delay(1)
CustomKeywords.‘clickUsingJS.clickingUsingJS’(findTestObject(‘Data/Audit Trail/Mailinator/Button_DownloadExport’), 5)
String fileName = WebUI.getText(findTestObject(‘Data/Audit Trail/Mailinator/Email Text’))