Text pasting in different line text box instead of intended line textbox

As mentioned katalon studio test case is pasting text in different line textbox like 2 or 3 rows below 2nd intended row but not the 2nd row,please help
I am testing this in oracle fusion cloud


1 Like

Hi @santhosh.khati, welcome to the community.

We need more information about your Test Case code and the HTML running on the page.

Please follow this advice:

1 Like

here how it works

program goes the above page and clicks on + button under “invoice lines” in screenshot and a new row will get created on the second line and program has to enter text on this second line,but it inserts in the line below it,please help

below is the code:

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testng.keyword.TestNGBuiltinKeywords as TestNGKW
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

WebUI.openBrowser(‘’)

WebUI.navigateToUrl(‘https://emze-test.login.ap2.oraclecloud.com’)

WebUI.maximizeWindow()

WebUI.setText(findTestObject(‘Object Repository/Page_Sign In/input_User ID_userid’), ‘santhosh.khati@cultfit.in’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/Page_Sign In/input_Password_password’), ‘up+3IOQy8oYM6+J9+4ucbw==’)

WebUI.click(findTestObject(‘Object Repository/Page_Sign In/button_Sign In’))

WebUI.click(findTestObject(‘Object Repository/Page_Welcome/svg_Favorites and Recent Items’))

WebUI.click(findTestObject(‘Object Repository/Page_Welcome/span_Manage Transactions’))

WebUI.setText(findTestObject(‘Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Transaction Number Operator__FOpt1_FO_3eed66’),
‘240006’)

WebUI.click(findTestObject(‘Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/button_Search’))

WebUI.click(findTestObject(‘Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_901715’))

WebUI.click(findTestObject(‘Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_6c0eed’))

WebUI.click(findTestObject(‘Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Number of Periods__FOpt1_FOr10_FOSrit_2e6301’))

WebUI.setText(findTestObject(‘Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Assessable Value__FOpt1_FOr10_FOSrite_f82baf’),
‘2’)

WebUI.setText(findTestObject(‘Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Line__FOpt1_FOr10_FOSritemNode_receiv_2e1a17’),
‘2nd line data’)

HTML PAGE CODE ELEMENT
HTML PAGE ELEMENT.txt (665.5 KB)
OF ABOVE PAGE IN SCREENSHOT:IN BELOW TEXT FILE

NO ERRORS BUT TEXT IS INSERTING IN THE WRONG LINE

Your table starts at line 0 (zero), so the second line should be 1. Unfortunately, if you insert a row into the table, the “new” row does not become the “next” number, but some seemingly random number. As an example, below are the first two rows in the table after I inserted the new row. The new row went into the second row.

//row1 = _FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:**0**:it27::content
//row2 = _FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:**8**:it27::content

As you can see from the part that I highlighted in the above, there is only I digit that is different. Now, the table starts at 0 and the new row would be the ninth, so 8 is correct, however, you would need to count how many rows there are to get the new row index.

import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory

def driver = DriverFactory.getWebDriver()
...
WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Number of Periods__FOpt1_FOr10_FOSrit_2e6301'))

WebUI.setText(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Assessable Value__FOpt1_FOr10_FOSrite_f82baf'), '2')

List<WebElement> list = driver.findElements(By.xpath('//input[contains(@id,"_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:") and contains(@id, ":it27::content")]')
rowCount = list.size()  // this is the number we want less one because we start at zero

myItem = driver.findElement(By.xpath("id('_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:${rowCount - 1}:it27::content')")
myItem.sendKeys("2nd line data")

I am using a substitution on the rowCount and you might have to play with the double quote and single quote placement. The substitution needs the double quotes, but the id should only need the single quote.

Edit: If I am on the wrong page and therefore the wrong table, my apologies, but I can only imagine what elements you are clicking on based on your naming convention / description that you are using, like: _FOpt1_FOr10_FOSritemNode_receiv_2e1a17. Perhaps, you can add some text of the element, like 'img_Reorder Columns_View_FOpt1_FOr10_FOSritemNo_901715`, or Edit or Action or AddRow… as I did not find any 901715 on the page.

An alternative would be to cycle through the table, perhaps using a for loop, and seeking a blank Description

import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory

def driver = DriverFactory.getWebDriver()

List<WebElement> list = driver.findElements(By.xpath('//input[contains(@id,"_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:") and contains(@id, ":it27::content")]')
rowCount = list.size()  // this is the number we want 

Pizza:
for (int cnt = 0; cnt < rowCount; cnt++) {
    myItem = driver.findElement(By.xpath("id('_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:${rowCount}:it27::content')")
    if (myItem.getText() == "") {
        myItem.sendKeys("2nd line data")
        break Pizza;
    }
}

where do i place the above code,sorry im a begginer in this,im getting below error

=============== ROOT CAUSE =====================

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

05-29-2023 01:32:14 PM Test Cases/b/scratch2

Elapsed time: 52.042s

Test Cases/b/scratch2 FAILED.
Reason:
groovy.lang.MissingPropertyException: No such property: By for class: Script1635229474429
at scratch2.run(scratch2:54)
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:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1685347330976.run(TempTestCase1685347330976.groovy:25)

import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement

near to this, you need one more import statement

import org.openqa.selenium.By

thanks but now im receving new error

=============== ROOT CAUSE =====================

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

05-29-2023 02:38:23 PM Test Cases/b/scratch2

Elapsed time: 24.599s

Test Cases/b/scratch2 FAILED.
Reason:
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {“method”:“xpath”,“selector”:“id(‘_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:126:it27::content’)”}
(Session info: chrome=113.0.5672.127)
For documentation on this error, please visit: /documentation/webdriver/troubleshooting/errors/
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-FAGQCI0’, ip: ‘192.168.29.117’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_282’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 113.0.5672.127, chrome: {chromedriverVersion: 113.0.5672.24 (65f30d4e8051…, userDataDir: C:\Users\SANTHO~1\AppData\L…}, goog:chromeOptions: {debuggerAddress: localhost:53363}, 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:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Session ID: c211b1889146a2b5c3a08c0a3ec67b20
*** Element info: {Using=xpath, value=id(‘_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:126:it27::content’)}
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.RemoteWebDriver.findElement(RemoteWebDriver.java:323)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:428)
at org.openqa.selenium.By$ByXPath.findElement(By.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:315)
at org.openqa.selenium.support.events.EventFiringWebDriver.lambda$new$1(EventFiringWebDriver.java:105)
at com.sun.proxy.$Proxy10.findElement(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.findElement(EventFiringWebDriver.java:194)
at org.openqa.selenium.WebDriver$findElement$0.call(Unknown Source)
at scratch2.run(scratch2:58)
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:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1685351301400.run(TempTestCase1685351301400.groovy:25)

You wrote:

Have you ever studied XPath? Maybe not. Then you need to study it. On the Internet, there are many free resources to study XPath. For example,

Have you ever used browser’s DevTools and had close look at the HTML source of your target web page using the DevTools? Maybe not. Then you need to know what DevTools does for you. See

Once you got studied those basic skills, you would be able to understand the reason why you got the error. Also you would understand what @grylion54 suggested to you in the previous post Text pasting in different line text box instead of intended line textbox - #4 by grylion54

Unless you study XPath and DevTools, I suppose you would never be able to solve your current problem.

_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:0:it27::content

Your test case seems relying on this cryptic value of a HTML id attribute.

I think that you should not look at this cryptic id value. Relying on this cryptic (and possibly dynamically changing) id value will make your test case hard to debug. Your test case will be fragile. You would not be able to trust your test case code.

You need to find out an alternative XPath expression that select the HTML element(s) you want without refering to this cryptic id value. I am certain, you need to write the XPath expression manually.

I guess, you created the Test Objects in the Object Repository using the Katalon’s Web Recording & Spy tools. I am afraid, these tools are useless for your case. These tools only work on simple HTMLs of 1990s. But your HTML is brand new (compiled by Oracle Fusion Cloud Application service), complicated, too difficult for the tools. These dum tools can not generate appropriate locators (XPath) that solve your problem automagically.

You need to get skilled enough so that you can create Test Objects with appropriated XPath expressions manually with help of browsers DevTools. Forget the Web Recording and Spy tools — these tools will waste your time and efforts.

guys please modify the above code i beg of you so that i may learn as well,you have my above source code with login details etc,i just want it to run please,please make it run

I looked at your concern again and I encountered an issue with the counting of the number of rows in the table every so often, so I added a hard coded delay() to my routine, but you can perhaps put in a waitFor statement to reduce the time.
You can create TestObjects of my pathways, including the one in which I do a substitution–for that one you will have to look up KS parameterization, which is discussed on this forum and in their documentation.

Maybe like:
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import org.openqa.selenium.Keys as Keys
import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory

import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable


WebUI.openBrowser('')

WebUI.navigateToUrl('https://emze-test.login.ap2.oraclecloud.com')

WebUI.maximizeWindow()

def driver = DriverFactory.getWebDriver()

WebUI.waitForElementVisible(findTestObject('Object Repository/Page_Sign In/input_User ID_userid'), 10)
WebUI.setText(findTestObject('Object Repository/Page_Sign In/input_User ID_userid'), 'santhosh.khati@cultfit.in')

WebUI.setEncryptedText(findTestObject('Object Repository/Page_Sign In/input_Password_password'), 'up+3IOQy8oYM6+J9+4ucbw==')

WebUI.click(findTestObject('Object Repository/Page_Sign In/button_Sign In'))
WebUI.waitForPageLoad(10)

WebUI.click(findTestObject('Object Repository/Page_Welcome/svg_Favorites and Recent Items'))
WebUI.waitForPageLoad(10)

WebUI.waitForElementVisible(indTestObject('Object Repository/Page_Welcome/span_Manage Transactions'), 10)
WebUI.click(findTestObject('Object Repository/Page_Welcome/span_Manage Transactions'))

WebUI.waitForElementVisible(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Transaction Number Operator__FOpt1_FO_3eed66'), 10)
WebUI.setText(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Transaction Number Operator__FOpt1_FO_3eed66'), '240006')

WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/button_Search'))
WebUI.waitForPageLoad(30)

WebUI.waitForElementVisible(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_901715'), 10)
WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_901715'))

WebUI.waitForElementVisible(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_6c0eed'), 10)
WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_6c0eed'))

// sorry, but I could not determine where these fields were
WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Number of Periods__FOpt1_FOr10_FOSrit_2e6301'))

WebUI.setText(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Assessable Value__FOpt1_FOr10_FOSrite_f82baf'), '2')

"drop down the page to the Incomplete phrase"
pItem = driver.findElement(By.xpath('//td[text()="Incomplete"]'))
WebUI.scrollToPosition(100, pItem.getLocation().getY())
WebUI.delay(3)  // put in a hard coded delay

"get the count of rows in the table"
List<WebElement> list = driver.findElements(By.xpath('//input[contains(@id,"_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:") and contains(@id, ":it27::content")]'))
rowCount = list.size()  // this is the number of rows in the table
WebUI.comment("Count is ${rowCount}")

xpathway = "id('_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:${rowCount-1}:it27::content')"
"lets look at the pathway"
WebUI.comment("pathway is ${xpathway}")

cellItem = driver.findElement(By.xpath(xpathway))
"put in the text"
cellItem.sendKeys("2nd line data")

I started thinking that you could go with your code/element but put in a delay beforehand and ensure the pathway for your element is to the new line. That way you would not need to know how many rows are in the table. You could have it “hardcoded” as whatever the new row was.

I am afraind, you haven’t disclosed enough information.

  1. The definition of Test Objects

For example, your test case script has a line:

WebUI.setText(findTestObject(‘Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Transaction Number Operator__FOpt1_FO_3eed66’),
‘240006’)

Here you used a Test Object with id Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Transaction Number Operator__FOpt1_FO_3eed66. The Test Object contains some locator (XPath expression or CSS Selector) defined in another file. It is critically important if the locators of Test Objects are correctly pointing the HTML elements in the target web page. Most probably, you have wrong locators in you test objects. You need to verify if the XPath expressions in the Test Objects are correct against the target HTML source.

You haven’t shared the definition of Test Objects yet. So, you should disclose the definition of all your Test Objects.

  1. Password

When one tries to open ‘https://emze-test.login.ap2.oraclecloud.com’ in browser, he/she is challenged for credentials.

Your test case script tells that the user id is santhosh.khati@cultfit.in. This is OK.

But your test case script has a line

WebUI.setEncryptedText(findTestObject(‘Object Repository/Page_Sign In/input_Password_password’), ‘up+3IOQy8oYM6+J9+4ucbw==’)

As this tells, the password is encrypted. Nobody, but you, can decrypt this. Therefore nobody, but you, can know the valid password string.

No, I can’t.

As described above, you need to disclose enough information about Test Objects.

And, if you want others to do it, you need to change your Test Case script so that it types the raw string value of password; and expose it to the guys on the Katalon User Forum.

But I would warn you, if you expose the raw password to public, it would be a serious risk for you and your organization. You should never do it.

Therefore, you should not ask the quest “please modify the above code” to others. Please know that nobody, other than you yourself, can do it.

hi guys thanks for all your replies,i think we could somehow pass the rownum value(or xpath rownum value) of new row generated generated by clicking the + button onto the recorded element which has static row num value in xpath

Although the element has a static row number, it isn’t apparent what the row number would be. That’s why I went the route to calculate the number,

"get the count of rows in the table"
List<WebElement> list = driver.findElements(By.xpath('//input[contains(@id,"_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:") and contains(@id, ":it27::content")]'))
rowCount = list.size()  // this is the number of rows in the table

xpathway = "id('_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:${rowCount-1}:it27::content')"

but if you are not going to change the data, then you can just use the static reference.

Also, give the table enough delay time to get it to completely form, like I did in my code in my post above.