# How to retrieve data or no. id from previous step when using katalon studio for testing

**URL:** <https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111>\
**Category:** Miscellaneous\
**Created:** [March 1, 2024, 6:50am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111 "2024-03-01T06:50:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![exampletestdummy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/exampletestdummy/32/23869_2.png) [@exampletestdummy](https://forum.katalon.com/u/exampletestdummy)\
**Post date:** [March 1, 2024, 6:50am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/1 "2024-03-01T06:50:19Z")

</div>

HI,

How to get or retrieve data from previous step when do testing? How to not duplicate new data when do repetition of testing

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 1, 2024, 7:31am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/2 "2024-03-01T07:31:35Z")

</div>

Use “GlobalVariable”. See the following doc.

> **[Global variables and Execution profile | Katalon Docs](https://docs.katalon.com/docs/katalon-studio/data-driven-testing/global-variables-and-execution-profile)**
>
> Global variables are pre-defined values that are accessible across all test cases, test objects, web service objects, and email configurations in a project. They are used to execute test scripts in multiple and different environments.

Though I am afraid that this doc page would be difficult for you to understand.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 1, 2024, 7:46am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/3 "2024-03-01T07:46:53Z")

</div>

Let me give you an example.

In the Execution Profile “default”, I made a Global Variable named `FAVORITE_THING` with a string value.

 ![スクリーンショット 2024-03-01 16.33.40](https://europe1.discourse-cdn.com/katalon/original/3X/9/d/9d5075ed0af4dfe5f65055ec315ebf22a27f2225.png)

I made a series of Test Cases: TCa, TCb, TCc, TCd

 ![スクリーンショット 2024-03-01 16.36.24](https://europe1.discourse-cdn.com/katalon/original/3X/e/5/e505d4422ed140be0ac28f668eff4509163b6aa7.png)

Each scripts manipulates the `GlobalVariable.FAVORITE_THING`.

### `Test Cases/TCa`:

```auto
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

WebUI.comment(">>>" + GlobalVariable.FAVORITE_THING)

GlobalVariable.FAVORITE_THING = "Bright copper kettles and warm woolen mittens"

```

Please find how this script reads the value of `GlobalVariable.FAVORITE_THING`, and how it updates it.

### `Test Cases/TCb`:

```auto
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

WebUI.comment(">>>" + GlobalVariable.FAVORITE_THING)

GlobalVariable.FAVORITE_THING = "Brown paper packages tied up with strings"

```

Please find that the TCb can refer to the value set by the TCa.

### `Test Cases/TCc`:

```auto
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

WebUI.comment(">>>" + GlobalVariable.FAVORITE_THING)

GlobalVariable.FAVORITE_THING = "These are a few of my favorite things"

```

### `Test Cases/TCd`:

```auto
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

WebUI.comment(">>>" + GlobalVariable.FAVORITE_THING)

```

I created “Test Suites/TS1”:

 ![スクリーンショット 2024-03-01 16.40.57](https://europe1.discourse-cdn.com/katalon/original/3X/8/c/8c890e89f3a5513307ccb830c8272493b0f54a5d.png)

When I ran the `TS1`, I got the following output:

 ![スクリーンショット 2024-03-01 16.42.16](https://europe1.discourse-cdn.com/katalon/original/3X/e/3/e3efecfebbfb41a08f007c0a186901dc43329ffd.png)

Is this what you wanted?

---

<div class="post-metadata">

**Author:** ![exampletestdummy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/exampletestdummy/32/23869_2.png) [@exampletestdummy](https://forum.katalon.com/u/exampletestdummy)\
**Post date:** [March 1, 2024, 9:04am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/4 "2024-03-01T09:04:16Z")

</div>

Thanks for the answer.

But my situation is using katalon, when I record the test and will be create new id. so after we want to check pass or not, we need to run the record. so after we run the record it will be create another new id

So, how to not create another id when rerun the record of step/testing?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 1, 2024, 9:06am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/5 "2024-03-01T09:06:46Z")

</div>

> [@exampletestdummy](#):
>
> will be create new id.

I do not see what you mean by the word `id`. Please clarify what the `id` you mean. Any screenshot?

---

<div class="post-metadata">

**Author:** ![exampletestdummy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/exampletestdummy/32/23869_2.png) [@exampletestdummy](https://forum.katalon.com/u/exampletestdummy)\
**Post date:** [March 4, 2024, 6:16am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/6 "2024-03-04T06:16:23Z")

</div>

i mean no. of registration

i have problem with,

when do the testing we need to generate new no of registration. then after we re run the recording or playback, katalon generate another new no of registration

so how to solve?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 4, 2024, 7:31am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/7 "2024-03-04T07:31:56Z")

</div>

> [@exampletestdummy](#):
>
> registration

What do you mean the word “registration”?

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [March 4, 2024, 3:45pm UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/8 "2024-03-04T15:45:40Z")

</div>

Maybe write out your registration id to a spreadsheet between test runs and then read the registration id back in from that spreadsheet.

> [@Katalon writing data to excel](http://forum.katalon.com/t/katalon-writing-data-to-excel/61587/2):
>
> I explained how you can do this in your other question on this topic. Start there. However, you need to move off the Manual tab onto the Script tab or you can “translate” what I put down from that question into the Manual tab. If this doesn’t fulfill your need, then we can give more information. Edit: To make it even easier, I brought what I wrote there over to this question: 
> 
> > **Maybe like this:**
> >
> > I need to read a client name between Test Suites, so I save the name from one Test Case of Suite 1 i…

---

<div class="post-metadata">

**Author:** ![exampletestdummy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/exampletestdummy/32/23869_2.png) [@exampletestdummy](https://forum.katalon.com/u/exampletestdummy)\
**Post date:** [March 5, 2024, 5:04am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/9 "2024-03-05T05:04:04Z")

</div>

can I know how the step when write out registration id to a spreadsheet

---

<div class="post-metadata">

**Author:** ![exampletestdummy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/exampletestdummy/32/23869_2.png) [@exampletestdummy](https://forum.katalon.com/u/exampletestdummy)\
**Post date:** [March 5, 2024, 5:06am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/10 "2024-03-05T05:06:23Z")

</div>

mean that number of the case

number of registration = number of case that will be registered

for example : 50550 (number id for case will be registered)

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [March 5, 2024, 6:49am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/11 "2024-03-05T06:49:27Z")

</div>

Click on the link (the blue text) in my post above and then click on the black arrow with the text, “ **Maybe like this:** ” and the sample text about writing to a spreadsheet will display. Review it and see if it will work for you.

---

<div class="post-metadata">

**Author:** ![exampletestdummy](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/exampletestdummy/32/23869_2.png) [@exampletestdummy](https://forum.katalon.com/u/exampletestdummy)\
**Post date:** [March 5, 2024, 8:08am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/12 "2024-03-05T08:08:36Z")

</div>

Alright thanks a lot

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [July 4, 2024, 7:26am UTC](https://forum.katalon.com/t/how-to-retrieve-data-or-no-id-from-previous-step-when-using-katalon-studio-for-testing/122111/13 "2024-07-04T07:26:01Z")

</div>

Closed on July 4, 2024, 7:26am UTC


