Variable from test in POST Request http Body

Hi,

i’m trying to use a variable from Test in a POst Request http body:

in the Test i’m getting the variable:

 String orderNumber = WebUI.getText(findTestObject('MSD/Internet/vf/orderNumber'))
 WS.sendRequest(findTestObject('TeamsSuiteDone',[('Bestellnummer'): ${orderNumber}]))

In http Body:

 "type": "TextBlock",
 "text": ${orderNumber},
 "wrap": true

image

Any Ideas ?

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Please enclose your code with a pair of triple backticsks:

Otherwise several characters will be silently replaced with other characters by the forum system Discourse; Your code becomes something different. Therefore people can not understand your question correctly.

Done, sorry i forgot …

WS.sendRequest(findTestObject('TeamsSuiteDone', 
        [('Bestellnummer'): "${orderNumber}"]))

You need to quote ${orderNumber} with a pair of double quotes which forms a Groovy’s GString with String Interpolation

Hi,

thanks for the advice. Unfortunately without any success.
I wonder why the WS.sendRequest is still underlined, which normaly idicates, that
there is something wrong or missing. Tried CTRL + Shift + O to update import statements,
but nothing changed.

WS.sendRequest(findTestObject(‘TeamsSuiteDone’, [(‘Bestellnummer’): “${orderNumber}”]))

Please share more information so that others can reproduce your problem on their machine in hand.

  1. the full source code of the Test Case
  2. the full log when you run the Test Case, including the error diagnostics
  3. the screenshot of the definition of the TestObject ‘TeamsSuiteDone’

Can you go into your object, TeamsSuiteDone, and copy the variable, “Bestellnummer” that’s there, and paste it again into your sendRequest statement just to check if you have a spelling mistake?

This means “order number” in German

https://www.collinsdictionary.com/dictionary/german-english/bestellnummer

Here we go:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import java.text.SimpleDateFormat
import org.apache.commons.lang.time.StopWatch
import org.openqa.selenium.Keys
import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.util.KeywordUtil
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable

RunConfiguration.setWebDriverPreferencesProperty('args', ['--window-size=1200,1900', '--disable-search-engine-choice-screen'
        , '--incognito', '--disable-dev-shm-usage', '--disable-infobars'])

NAME = "Name";
LASTNAME = "SurName";
STREETNUMBER = "4c";
STREET = "Street";
ZIP = "00000";
MAIL = "Mail";
PREFIX = "000"
TEL = "12345678";
IBAN = "IBAN";
DOB = "11.11.1969"
PKK = "0815"

WebUI.openBrowser('')
WebUI.deleteAllCookies()
Date today = new Date()
SimpleDateFormat formater = new SimpleDateFormat('dd.MM.yyy')
String timestamp = formater.format(today)
'Ladezeitmessung Start'
StopWatch stopwatch = new StopWatch()
stopwatch.start()

/** Auth wenn INT **/
if (GlobalVariable.type == 'stage') {
    WebUI.authenticate(GlobalVariable.url, user', 'pass', 5, FailureHandling.OPTIONAL)
}

/** Kein Auth wenn LIVE **/
WebUI.navigateToUrl(GlobalVariable.url + 'dsl-und-internet')

NoCookiesToday = WebUI.verifyElementPresent(findTestObject('MSD/MM_Bestellung/clickCookieBanner'), 5, FailureHandling.OPTIONAL)

if (NoCookiesToday) {
    WebUI.click(findTestObject('MSD/MM_Bestellung/clickCookieBanner'), FailureHandling.OPTIONAL)
}

stopwatch.stop()
long timeTaken = stopwatch.getTime() / 1000 // seconds
String activationDate = formater.format(today.plus(22))
WebUI.comment(">>> timeTaken = $timeTaken")
WebUI.comment(('Die Ladezeit der Seite betrug: ' + timeTaken) + 'Sekunden')
KeywordUtil.logInfo(('Die Ladezeit der Seite betrug ' + timeTaken) + ' Sekunden')
WebUI.verifyLessThan(timeTaken, 10, FailureHandling.STOP_ON_FAILURE)
WebUI.setText(findTestObject('MSD/Internet/zip'),ZIP)
WebUI.waitForElementClickable(findTestObject('MSD/Internet/street'), 5)
WebUI.setText(findTestObject('MSD/Internet/street'),STREET)
WebUI.waitForElementClickable(findTestObject('MSD/Internet/streetnumber'), 5)
WebUI.setText(findTestObject('MSD/Internet/streetnumber'),STREETNUMBER)
WebUI.delay(2)
WebUI.click(findTestObject('MSD/Internet/buttonCalculate'))
WebUI.waitForElementVisible(findTestObject('MSD/Internet/sucessMessageBox'),60)
WebUI.sendKeys(findTestObject('MSD/Internet/filtero2'), Keys.chord(Keys.PAGE_DOWN))
WebUI.waitForElementVisible(findTestObject('MSD/Internet/o2/filterO2'),60)
WebUI.click(findTestObject('MSD/Internet/o2/filterO2'))
WebUI.delay(2)
WebUI.scrollToElement(findTestObject('MSD/Internet/o2/o2-cable-250'),30)
WebUI.click(findTestObject('MSD/Internet/o2/o2-cable-250'))
WebUI.delay(3)
WebUI.scrollToElement(findTestObject('MSD/Internet/o2/hardware/fb6660Cable'), 30)
WebUI.delay(3)
WebUI.click(findTestObject('MSD/Internet/o2/hardware/fb6660Cable'))
WebUI.sendKeys(findTestObject(null), Keys.chord(Keys.END))
WebUI.click(findTestObject('MSD/Internet/o2/orderNow'))
WebUI.delay(4)

// Anschluss

WebUI.click(findTestObject('MSD/Internet/o2/providerChangeNo'))
WebUI.scrollToElement(findTestObject('MSD/Internet/o2/activationDate'),30)
WebUI.delay(2)
WebUI.click(findTestObject('MSD/Internet/o2/activationDate'))
WebUI.delay(2)
WebUI.setText(findTestObject('MSD/Internet/o2/activationdate'), activationDate)
WebUI.delay(2)
WebUI.sendKeys(findTestObject(null), Keys.chord(Keys.END))
WebUI.delay(2)
WebUI.click(findTestObject('MSD/Internet/o2/orderNow'))

// Persöliche Daten
WebUI.delay(2)
WebUI.click(findTestObject('MSD/Internet/o2/gender'))
WebUI.setText(findTestObject('MSD/Internet/o2/name'), NAME)
WebUI.setText(findTestObject('MSD/Internet/o2/lastname'), LASTNAME)
WebUI.setText(findTestObject('MSD/Internet/o2/dob'), DOB)
WebUI.setText(findTestObject('MSD/Internet/o2/telPrefix'), PREFIX)
WebUI.setText(findTestObject('MSD/Internet/o2/tel'), TEL)
WebUI.setText(findTestObject('MSD/Internet/o2/mail'), MAIL)
WebUI.setText(findTestObject('MSD/Internet/o2/confirmMail'), MAIL)

WebUI.sendKeys(findTestObject('MSD/Internet/o2/confirmMail'), Keys.chord(Keys.PAGE_DOWN))
WebUI.click(findTestObject('MSD/Internet/o2/checkBoxIban'))
WebUI.delay(1)
WebUI.setText(findTestObject('MSD/Internet/o2/iban'), IBAN)
WebUI.click(findTestObject('MSD/Internet/o2/checkBoxIban'))
WebUI.delay(1)
WebUI.click(findTestObject('MSD/Internet/o2/checkBoxIban'))
WebUI.delay(1)
WebUI.click(findTestObject('MSD/Internet/o2/orderNow'))
WebUI.delay(1)

// Vertragszusammenfassung
WebUI.click(findTestObject('MSD/Internet/o2/evnNo'))
WebUI.setText(findTestObject('MSD/Internet/o2/pcc'), PKK)
WebUI.sendKeys(findTestObject(null), Keys.chord(Keys.PAGE_DOWN))
WebUI.delay(1)
WebUI.click(findTestObject('MSD/Internet/o2/eeccCheckBox'))
WebUI.click(findTestObject('MSD/Internet/o2/orderNow'))
WebUI.sendKeys(findTestObject(null), Keys.chord(Keys.END))
WebUI.delay(2)
WebUI.sendKeys(findTestObject(null), Keys.chord(Keys.END))

//EECC Button - gleich wie orderNow
WebUI.click(findTestObject('MSD/Internet/o2/orderNow'))
WebUI.waitForElementVisible(findTestObject('MSD/Internet/o2/orderNumber'), 10)
String orderNumber = WebUI.getText(findTestObject('MSD/Internet/o2/orderNumber'))
WS.sendRequest(findTestObject('TeamsSuiteDone', [('Bestellnummer'): "${orderNumber}"]))
WebUI.comment(orderNumber)

Http body:

{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "content": {
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "type": "AdaptiveCard",
        "version": "1.0",
        "body": [
          {
            "type": "ColumnSet",
            "columns": [
              {
                "type": "Column",
                "width": "auto",
                "items": [
                  {
                    "type": "Image",
                    "url": "http://jurczyk.org/skon.png",
                    "size": "medium"
                  }
                ]
              },
              {
                "type": "Column",
                "width": "stretch",
                "items": [
                  {
                    "type": "TextBlock",
                    "text": "Katalon Test Done",
                    "weight": "bolder",
                    "size": "large"
                  },
                  {
                    "type": "TextBlock",
                    "text": ${orderNumber},
                    "wrap": true
                   	
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ]
}

2024-08-27 08:50:24.738 INFO  c.k.katalon.core.main.TestCaseExecutor   - --------------------
2024-08-27 08:50:24.740 INFO  c.k.katalon.core.main.TestCaseExecutor   - START Test Cases/MSD/internetDsl/o2/orderInternetO2Cable250Fb6660 - DEV
2024-08-27 08:50:25.058 INFO  c.k.katalon.core.main.TestCaseExecutor   - (Default) orderNumber = 1
2024-08-27 08:50:25.571 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 1: setWebDriverPreferencesProperty("args", ["--window-size=1200,1900", "--disable-search-engine-choice-screen", "--incognito", "--disable-dev-shm-usage", "--disable-infobars"])
2024-08-27 08:50:25.575 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 2: NAME = "Name"
2024-08-27 08:50:25.579 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 3: LASTNAME = "SurName"
2024-08-27 08:50:25.581 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 4: STREETNUMBER = "4c"
2024-08-27 08:50:25.583 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 5: STREET = "Street"
2024-08-27 08:50:25.585 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 6: ZIP = "00000"
2024-08-27 08:50:25.587 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 7: MAIL = "Mail"
2024-08-27 08:50:25.589 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 8: PREFIX = "000"
2024-08-27 08:50:25.590 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 9: TEL = "12345678"
2024-08-27 08:50:25.592 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 10: IBAN = "IBAN"
2024-08-27 08:50:25.595 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 11: DOB = "11.11.1969"
2024-08-27 08:50:25.597 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 12: PKK = "0815"
2024-08-27 08:50:25.599 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 13: openBrowser("")
2024-08-27 08:50:25.828 INFO  c.k.k.core.webui.driver.DriverFactory    - Starting 'Chrome' driver
Aug. 27, 2024 8:50:25 AM org.openqa.selenium.remote.DesiredCapabilities chrome
INFORMATION: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
2024-08-27 08:50:25.842 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['property', '--window-size=1500,1000']
2024-08-27 08:50:25.842 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['args', '[--window-size=1200,1900, --disable-search-engine-choice-screen, --incognito, --disable-dev-shm-usage, --disable-infobars]']
2024-08-27 08:50:25.862 INFO  c.k.k.core.webui.driver.DriverFactory    - Action delay is set to 150 milliseconds
Starting ChromeDriver 127.0.6533.88 (a2d0cb026721e4644e489b8ebb07038ca4e4351c-refs/branch-heads/6533@{#1846}) on port 61126
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Aug. 27, 2024 8:50:27 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Detected dialect: W3C
2024-08-27 08:50:27.949 INFO  c.k.k.core.webui.driver.DriverFactory    - sessionId = 994e57b1598d80e89f097aec8d3df2f7
2024-08-27 08:50:27.962 INFO  c.k.k.core.webui.driver.DriverFactory    - browser = Chrome 127.0.0.0
2024-08-27 08:50:27.963 INFO  c.k.k.core.webui.driver.DriverFactory    - platform = Windows 11
2024-08-27 08:50:27.963 INFO  c.k.k.core.webui.driver.DriverFactory    - seleniumVersion = 3.141.59
2024-08-27 08:50:27.964 INFO  c.k.k.core.webui.driver.DriverFactory    - proxyInformation = ProxyInformation { proxyOption=NO_PROXY, proxyServerType=HTTP, username=, password=********, proxyServerAddress=, proxyServerPort=0, executionList="", isApplyToDesiredCapabilities=true }
2024-08-27 08:50:27.977 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 14: deleteAllCookies()
2024-08-27 08:50:28.000 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 15: today = new java.util.Date()
2024-08-27 08:50:28.008 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 16: formater = new java.text.SimpleDateFormat(dd.MM.yyy)
2024-08-27 08:50:28.025 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 17: timestamp = formater.format(today)
2024-08-27 08:50:28.028 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 18: stopwatch = new org.apache.commons.lang.time.StopWatch()
2024-08-27 08:50:28.036 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 19: stopwatch.start()
2024-08-27 08:50:28.039 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 20: if (type == "stage")
2024-08-27 08:50:28.194 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 21: navigateToUrl(url + "dsl-und-internet")
2024-08-27 08:50:29.307 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 22: NoCookiesToday = verifyElementPresent(findTestObject("MSD/MM_Bestellung/clickCookieBanner"), 5, OPTIONAL)
2024-08-27 08:50:29.568 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 23: if (NoCookiesToday)
2024-08-27 08:50:29.585 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 1: click(findTestObject("MSD/MM_Bestellung/clickCookieBanner"), OPTIONAL)
2024-08-27 08:50:29.836 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 24: stopwatch.stop()
2024-08-27 08:50:29.840 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 25: timeTaken = stopwatch.getTime() / 1000
2024-08-27 08:50:29.849 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 26: activationDate = formater.format(today.plus(22))
2024-08-27 08:50:29.855 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 27: comment(>>> timeTaken = $timeTaken)
2024-08-27 08:50:29.899 INFO  c.k.k.c.keyword.builtin.CommentKeyword   - >>> timeTaken = 1
2024-08-27 08:50:29.900 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 28: comment("Die Ladezeit der Seite betrug: " + timeTaken + "Sekunden")
2024-08-27 08:50:29.904 INFO  c.k.k.c.keyword.builtin.CommentKeyword   - Die Ladezeit der Seite betrug: 1Sekunden
2024-08-27 08:50:29.905 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 29: logInfo("Die Ladezeit der Seite betrug " + timeTaken + " Sekunden")
2024-08-27 08:50:29.911 INFO  com.kms.katalon.core.util.KeywordUtil    - Die Ladezeit der Seite betrug 1 Sekunden
2024-08-27 08:50:29.912 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 30: verifyLessThan(timeTaken, 10, STOP_ON_FAILURE)
2024-08-27 08:50:29.928 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 31: setText(findTestObject("MSD/Internet/zip"), ZIP)
2024-08-27 08:50:30.393 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 32: waitForElementClickable(findTestObject("MSD/Internet/street"), 5)
2024-08-27 08:50:30.551 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 33: setText(findTestObject("MSD/Internet/street"), STREET)
2024-08-27 08:50:30.998 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 34: waitForElementClickable(findTestObject("MSD/Internet/streetnumber"), 5)
2024-08-27 08:50:31.037 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 35: setText(findTestObject("MSD/Internet/streetnumber"), STREETNUMBER)
2024-08-27 08:50:31.430 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 36: delay(2)
2024-08-27 08:50:33.447 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 37: click(findTestObject("MSD/Internet/buttonCalculate"))
2024-08-27 08:50:33.678 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 38: waitForElementVisible(findTestObject("MSD/Internet/sucessMessageBox"), 60)
2024-08-27 08:50:33.724 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 39: sendKeys(findTestObject("MSD/Internet/filtero2"), Keys.chord(PAGE_DOWN))
2024-08-27 08:50:33.725 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/MSD/Internet/filtero2' does not exist
2024-08-27 08:50:33.740 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/' does not exist
2024-08-27 08:50:33.952 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 40: waitForElementVisible(findTestObject("MSD/Internet/o2/filterO2"), 60)
2024-08-27 08:50:38.066 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 41: click(findTestObject("MSD/Internet/o2/filterO2"))
2024-08-27 08:50:38.286 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 42: delay(2)
2024-08-27 08:50:40.290 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 43: scrollToElement(findTestObject("MSD/Internet/o2/o2-cable-250"), 30)
2024-08-27 08:50:40.325 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 44: click(findTestObject("MSD/Internet/o2/o2-cable-250"))
2024-08-27 08:50:40.540 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 45: delay(3)
2024-08-27 08:50:43.555 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 46: scrollToElement(findTestObject("MSD/Internet/o2/hardware/fb6660Cable"), 30)
2024-08-27 08:50:43.585 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 47: delay(3)
2024-08-27 08:50:46.595 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 48: click(findTestObject("MSD/Internet/o2/hardware/fb6660Cable"))
2024-08-27 08:50:46.828 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 49: sendKeys(findTestObject(null), Keys.chord(END))
2024-08-27 08:50:46.828 WARN  c.k.k.core.testobject.ObjectRepository   - Test object id is null
2024-08-27 08:50:46.831 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/' does not exist
2024-08-27 08:50:47.033 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 50: click(findTestObject("MSD/Internet/o2/orderNow"))
2024-08-27 08:50:47.257 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 51: delay(4)
2024-08-27 08:50:51.267 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 52: click(findTestObject("MSD/Internet/o2/providerChangeNo"))
2024-08-27 08:50:51.516 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 53: scrollToElement(findTestObject("MSD/Internet/o2/activationDate"), 30)
2024-08-27 08:50:51.546 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 54: delay(2)
2024-08-27 08:50:53.561 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 55: click(findTestObject("MSD/Internet/o2/activationDate"))
2024-08-27 08:50:53.808 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 56: delay(2)
2024-08-27 08:50:55.818 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 57: setText(findTestObject("MSD/Internet/o2/activationdate"), activationDate)
2024-08-27 08:50:56.264 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 58: delay(2)
2024-08-27 08:50:58.270 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 59: sendKeys(findTestObject(null), Keys.chord(END))
2024-08-27 08:50:58.270 WARN  c.k.k.core.testobject.ObjectRepository   - Test object id is null
2024-08-27 08:50:58.273 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/' does not exist
2024-08-27 08:50:58.460 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 60: delay(2)
2024-08-27 08:51:00.473 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 61: click(findTestObject("MSD/Internet/o2/orderNow"))
2024-08-27 08:51:00.693 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 62: delay(2)
2024-08-27 08:51:02.702 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 63: click(findTestObject("MSD/Internet/o2/gender"))
2024-08-27 08:51:02.966 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 64: setText(findTestObject("MSD/Internet/o2/name"), NAME)
2024-08-27 08:51:03.398 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 65: setText(findTestObject("MSD/Internet/o2/lastname"), LASTNAME)
2024-08-27 08:51:03.825 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 66: setText(findTestObject("MSD/Internet/o2/dob"), DOB)
2024-08-27 08:51:04.266 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 67: setText(findTestObject("MSD/Internet/o2/telPrefix"), PREFIX)
2024-08-27 08:51:04.675 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 68: setText(findTestObject("MSD/Internet/o2/tel"), TEL)
2024-08-27 08:51:05.111 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 69: setText(findTestObject("MSD/Internet/o2/mail"), MAIL)
2024-08-27 08:51:05.643 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 70: setText(findTestObject("MSD/Internet/o2/confirmMail"), MAIL)
2024-08-27 08:51:06.196 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 71: sendKeys(findTestObject("MSD/Internet/o2/confirmMail"), Keys.chord(PAGE_DOWN))
2024-08-27 08:51:06.416 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 72: click(findTestObject("MSD/Internet/o2/checkBoxIban"))
2024-08-27 08:51:06.668 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 73: delay(1)
2024-08-27 08:51:07.678 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 74: setText(findTestObject("MSD/Internet/o2/iban"), IBAN)
2024-08-27 08:51:08.150 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 75: click(findTestObject("MSD/Internet/o2/checkBoxIban"))
2024-08-27 08:51:08.381 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 76: delay(1)
2024-08-27 08:51:09.391 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 77: click(findTestObject("MSD/Internet/o2/checkBoxIban"))
2024-08-27 08:51:09.627 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 78: delay(1)
2024-08-27 08:51:10.638 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 79: click(findTestObject("MSD/Internet/o2/orderNow"))
2024-08-27 08:51:10.878 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 80: delay(1)
2024-08-27 08:51:11.893 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 81: click(findTestObject("MSD/Internet/o2/evnNo"))
2024-08-27 08:51:12.151 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 82: setText(findTestObject("MSD/Internet/o2/pcc"), PKK)
2024-08-27 08:51:12.607 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 83: sendKeys(findTestObject(null), Keys.chord(PAGE_DOWN))
2024-08-27 08:51:12.607 WARN  c.k.k.core.testobject.ObjectRepository   - Test object id is null
2024-08-27 08:51:12.614 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/' does not exist
2024-08-27 08:51:12.829 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 84: delay(1)
2024-08-27 08:51:13.837 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 85: click(findTestObject("MSD/Internet/o2/eeccCheckBox"))
2024-08-27 08:51:14.078 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 86: click(findTestObject("MSD/Internet/o2/orderNow"))
2024-08-27 08:51:14.304 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 87: sendKeys(findTestObject(null), Keys.chord(END))
2024-08-27 08:51:14.304 WARN  c.k.k.core.testobject.ObjectRepository   - Test object id is null
2024-08-27 08:51:14.306 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/' does not exist
2024-08-27 08:51:14.493 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 88: delay(2)
2024-08-27 08:51:16.508 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 89: sendKeys(findTestObject(null), Keys.chord(END))
2024-08-27 08:51:16.510 WARN  c.k.k.core.testobject.ObjectRepository   - Test object id is null
2024-08-27 08:51:16.514 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/' does not exist
2024-08-27 08:51:16.727 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 90: click(findTestObject("MSD/Internet/o2/orderNow"))
2024-08-27 08:51:16.947 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 91: waitForElementVisible(findTestObject("MSD/Internet/o2/orderNumber"), 10)
2024-08-27 08:51:17.260 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 92: orderNumber = getText(findTestObject("MSD/Internet/o2/orderNumber"))
2024-08-27 08:51:17.287 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 93: sendRequest(findTestObject("TeamsSuiteDone", ["Bestellnummer":$orderNumber]))
2024-08-27 08:51:18.548 INFO  c.k.k.core.webservice.common.HarLogger   - HAR: 
2024-08-27 08:51:18.601 DEBUG t.orderInternetO2Cable250Fb6660 - DEV    - 94: comment(orderNumber)
2024-08-27 08:51:18.602 INFO  c.k.k.c.keyword.builtin.CommentKeyword   - Bestellung 1300033009477
2024-08-27 08:51:19.001 INFO  c.k.katalon.core.main.TestCaseExecutor   - END Test Cases/MSD/internetDsl/o2/orderInternetO2Cable250Fb6660 - DEV

Lot of code, if i missed something let me know

In the Test Case, you have this line:

And you have the following section in the HTTP Body:

                    "text": ${orderNumber},

This combination would not work.

If you want to keep the Test Case as is, you should change the HTTP Body as follows:

                    "text": ${Bestellnummer},

or

                    "text": "${Bestellnummer}",

Theory

In the Test Case you want to write

findTestObject(testObjectRelativeId, [ key:value, keyX:valueX, ...])

and in the RequestObject = HTTP Body, you should write:

    ... ${key} ...

then the ${key} will be interpolated with the given value. So, you would get

    ... value ...

Your mistake

In the HTTP Body, @Frank.Jurczyk wrote something like

    ... ${value} ...

This will be left as is; no string interpolation will take place

One additon.

You had better edit your Test Case as follows:

String orderNumber = WebUI.getText(findTestObject('MSD/Internet/o2/orderNumber'))
// WS.sendRequest(findTestObject('TeamsSuiteDone', [('Bestellnummer'): "${orderNumber}"]))
WS.sendRequest(findTestObject('TeamsSuiteDone', [('Bestellnummer'): orderNumber]))
WebUI.comment(orderNumber)

Enclosing orderNumber with "${ }" is just redundant. Not necessary.

uff, that was some piece of work.
I made the changes you considered and the test went trough as passed , but
now the message inteams was not showing. A look into the .har file showed that the var was correct
in the body, but now as " Bestellnummer 1300000000"

The var was declared as String so the Post failed (i guess), i had to trim the var in the test,
leaving only the numbers and it worked:

image

Thanks a lot kazurayam for your help !!!