No longer able to us WebUI.GetText successfully from within Mailinator email body

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:

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$ Source)
at Verify Audit Trail List can be Audit Trail List can be Exported:87)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
at com.kms.katalon.core.main.TestCaseExecutor.runScript(
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
at com.kms.katalon.core.main.TestCaseExecutor.execute(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)
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: ‘’, ‘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(
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(
at org.openqa.selenium.remote.HttpCommandExecutor.execute(
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at com.kms.katalon.selenium.driver.CChromeDriver.execute(
at org.openqa.selenium.remote.RemoteWebElement.execute(
at org.openqa.selenium.remote.RemoteWebElement.getText(
at com.sun.proxy.$Proxy10.getText(Unknown Source)
at com.kms.katalon.core.webui.keyword.builtin.GetTextKeyword$_getText_closure1.doCall(GetTextKeyword.groovy:80)
at com.kms.katalon.core.webui.keyword.builtin.GetTextKeyword$
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() = ’
’ or . = ’

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

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

, or 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 and

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.delay(3)‘Data/Audit Trail/Mailinator/First Email’))


‘verify email is recieved and contains correct info’
WebUI.scrollToElement(findTestObject(‘Data/Audit Trail/Mailinator/Email Body’), 0)


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’))


CustomKeywords.‘clickUsingJS.clickingUsingJS’(findTestObject(‘Data/Audit Trail/Mailinator/Button_DownloadExport’), 5)

String fileName = WebUI.getText(findTestObject(‘Data/Audit Trail/Mailinator/Email Text’))


Do you want to get text of the highlighted element below?

If yes, please follow next

//iframe[@id = ‘msg_body’ and @title = ‘Email Message Body’ and @name = ‘msg_body’ and (text() = ’
’ or . = ’

The iframe locator seems to be correct.

The root cause of the exception means that Selenium/Katalon could not use JavaScript on the null element:

Caused by: org.openqa.selenium.JavascriptException: javascript error: Cannot read property ‘clientWidth’ of null
(Session info: chrome=85.0.4183.83)

Can you share the locator of Data/Audit Trail/Mailinator/Email Text test object?

The object I’d use in this case (and after switching to the iFrame) would probably look like this:


Please try to change Data/Audit Trail/Mailinator/Email Text locator to:




@duyluong Same issue when doing that

@duyluong - even just trying to perform a WebUI.VerifyTextPresent(‘hi there’, false) is telling me it’s not there, but it is when I view source.

I just using Katalon Recorder to record this page: The test ran well.


Here is the same project: (15.2 KB)

@duyluong - Thank you very much for your assistance on this.

In fact the actual emails that I am sending and validating against are different than this plain text email and may be part of the issue (although there have been no recent changes to the emails). Here’s what seems to work though.

Replace the WebUI.getText statements with something like the following:

String code = WebUI.getAttribute(findTestObject(’<- insert object here ->’), ‘innerText’)

While there is no ‘innerText’ attribute explicitly being used on this object or visible in source, the getAttribute command is able to use this, along with the provided object, (and the switch into the iFrame) to find and return text, in this case returned to a String variable “code”, so that it can be passed around, validated, or used downstream in the script.

I’ve seen this in other objects that have changed (where text is no longer text on an object, but needs to be extracted from a WebUI.getAttribute statement, but usually there is a named attribute I can see the text value stored in and referenced in the statement. “innerText” appears to work for text that is just in a

1 Like

Hi –

Sam from Mailinator here !

We did indeed make a change as indicated, however to our surprise it was specifically around html
sanitization of email content. No changes to our site happened.

We’re very careful about ever changing HTML structure as we realize users depend on it. Typically we version the entire site when going to new HTML with old versions remaining available.

We’ve briefly looked at the issue above. If anyone has ideas of what happened, or what we can do to make things more identifiable we’d be interested in hearing them.


Hi @j.theysmeyer,
Thank you for sharing your findings. Our tests begon to fail also at 6thSept.
I can now again verify the content of emails using WebUI.getAttribute(,‘innerText’) instead of WebUI.getText()


My understanding is you want Item awarded text only. If so Try

I also think, as per your comment, the content is inside an iframe. So all you have to use


String text = driver.findElement(By.cssSelector(“p:nth-child(3)”)).getText();

Just tested. The code above works perfectly.