# Script Editor can show the intensity of used/looped in runs.

**URL:** <https://forum.katalon.com/t/script-editor-can-show-the-intensity-of-used-looped-in-runs/116494>\
**Category:** Feature Request\
**Tags:** katalon-studio\
**Created:** [February 2, 2024, 10:54am UTC](https://forum.katalon.com/t/script-editor-can-show-the-intensity-of-used-looped-in-runs/116494 "2024-02-02T10:54:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![valentijn.peters](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/valentijn.peters/32/23870_2.png) [@valentijn.peters](https://forum.katalon.com/u/valentijn.peters)\
**Post date:** [February 2, 2024, 10:54am UTC](https://forum.katalon.com/t/script-editor-can-show-the-intensity-of-used-looped-in-runs/116494/1 "2024-02-02T10:54:29Z")

</div>

The idea is next level User Interface shizzle…

But it would we awesome feature if it worked.

The idea is as following. By means of a shortcut you can show for a second, minute, or constant, what the intensity of a section of a if then else else if etc. part is of a code script is hit when run

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/9/c/9c46aad9e52c685ea2ca342d2c36d1953fcdafb7.jpeg)

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/b/7/b779988f5b598275096a0c83a8b8a3155bea4c68.png)

A if else section that almost never is used is color yellow.  
an if else section that the browser always goes into is red

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/b/7/b779988f5b598275096a0c83a8b8a3155bea4c68.png)

I hope the idea is clear…

---

<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:** [February 2, 2024, 7:14pm UTC](https://forum.katalon.com/t/script-editor-can-show-the-intensity-of-used-looped-in-runs/116494/2 "2024-02-02T19:14:26Z")

</div>

This would mean there is a **storage** of your **previous** test run in order to make the needed comparisons AND that **storage** would likely be on Katalon’s servers. That would also mean a **paid** subscription.

Personally, if I have created code to use an **if block** or **switch case** , then at the time, I believed it was a possibility, especially using the **default** (in switch case). I couldn’t care less if it was never used–it is/was a possibility and painting it wouldn’t mean it was any less useful.

Edit: you were asked to put all your ideas into one posting so that it would be easier on Katalon staff. By all means, copy and paste this to your one posting that would be your proxy.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 3, 2024, 5:42pm UTC](https://forum.katalon.com/t/script-editor-can-show-the-intensity-of-used-looped-in-runs/116494/3 "2024-02-03T17:42:26Z")

</div>

> [@valentijn.peters](#):
>
> I hope the idea is clear…

Very clear. It’s very like a heat map.

In my Katalon test code, this would be very easy to add. I didn’t like the way Katalon organized its “steps” so I wrote my own – therefore I could add this kind of functionality relatively easily.

In _your_ test cases, and to continue using Katalon’s notion of “steps”, you would need to learn about implementing groovy metaprogramming, creating metaclasses and methods that “wrap” the core Katalon implementations.

Can and could be done, but that’s a LOT of work.

> [@grylion54](#):
>
> Personally, if I have created code to use an **if block** or **switch case** , then at the time, I believed it was a possibility, especially using the **default** (in switch case). I couldn’t care less if it was never used–it is/was a possibility and painting it wouldn’t mean it was any less useful.

My guess is, @valentijn.peters has some “defensive coding” going on… covering “just in case” stuff with conditionals that might not be needed. I’ve done it when testing new stuff I’m not sure about.

---

<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:** [February 3, 2024, 8:41pm UTC](https://forum.katalon.com/t/script-editor-can-show-the-intensity-of-used-looped-in-runs/116494/4 "2024-02-03T20:41:32Z")

</div>

Instead of waiting for Katalon staff to implement this, why don’t you just read/write the number of times a condition is used to a spreadsheet or text file and then review it.

> **Maybe like:**
>
> You will need to create a spreadsheet and give the routine a pathway to that spreadsheet. I just used “Sheet1” as the first sheet but you can create multiple sheets, one for each condition but you will have to supply the sheet name as well with the parameters for your Keyword/routine. You can also have a parameter for more conditions.  
> “Read the numbers in”
> 
> ```auto
> import org.apache.poi.ss.usermodel.Cell
> import org.apache.poi.ss.usermodel.Row
> import org.apache.poi.xssf.usermodel.XSSFSheet
> import org.apache.poi.xssf.usermodel.XSSFWorkbook
> 
> gTestPathWay = "G:\\Katalon Test Cases\\Data Files\\Test route.xlsx";
> 
> @Keyword
> public List<Integer> ReadCondition(String gTestPathWay, int routeCount ...)
> FileInputStream fis = new FileInputStream (gTestPathWay );
> XSSFWorkbook workbook = new XSSFWorkbook (fis);
> 
> List<Integer> intRouteWay = new ArrayList<Integer>();
> 
> XSSFSheet sheet = workbook.getSheet("Sheet1");
> 
> for (int cnt = 1; cnt <= routeCount ; cnt++) {
> // start at cell A2;
> Row row = sheet.getRow(cnt);
> Cell cell = row.getCell(0);
> intRouteWay.add( cell.getStringCellValue() as int)
> }
> fis.close()
> }
> 
> ```
> 
> and you start it like:  
> `gRouteWay = CustomKeywords.'com.tools.ReadCondition'(gTestPathWay , 3, ...)`
> 
> The below is just a thought.to write your number back to your spreadsheet. You will have to flush it out what can be in the Keyword or 2 Keywords or whatever.
> 
> ```auto
> if (condition1) {
> // cell A2
> gRouteWay.get(1)++
> //blah blah
>  
> } else if {condition2) {
> // cell A3
> gRouteWay.get(2)++
> //blah blah
> 
> } else {
> // cell A4
> gRouteWay.get(3)++
> //blah blah
> 
> }
> 
> import org.apache.poi.ss.usermodel.Cell
> import org.apache.poi.ss.usermodel.Row
> import org.apache.poi.xssf.usermodel.XSSFSheet
> import org.apache.poi.xssf.usermodel.XSSFWorkbook
> 
> gTestPathWay = "G:\\Katalon Test Cases\\Data Files\\Test route.xlsx";
> 
> @Keyword
> public void WriteCondition(String gTestPathWay, List<Integer> gRouteWay, int routeCount ...) {
> /* open connection to MS Excel, save condition pathway to sheet 1, cell A{whatever}, close connection */
> FileInputStream fis = new FileInputStream (gTestPathWay );
> XSSFWorkbook workbook = new XSSFWorkbook (fis);
> 
> XSSFSheet sheet = workbook.getSheet("Sheet1");
> for (int cnt = 1; cnt <= routeCount ; cnt++) {
> // start at cell A2;
> Row row = sheet.createRow(cnt);
> 
> cell.setCellValue(gRouteWay.get(cnt));
> 
> FileOutputStream fos = new FileOutputStream(gTestPathWay);
> workbook.write(fos);
> fos.flush();
> fos.close();
> }
> 
> fis.close();
> }
> 
> ```

And then in Excel, you can have the values given colour with conditional formatting:

[How to Use Color Scales in Excel (Conditional Formatting) (youtube.com)](https://www.youtube.com/watch?v=fj6VtUi2s9s&t=26s)

---

<div class="post-metadata">

**Author:** ![valentijn.peters](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/valentijn.peters/32/23870_2.png) [@valentijn.peters](https://forum.katalon.com/u/valentijn.peters)\
**Post date:** [February 6, 2024, 9:34am UTC](https://forum.katalon.com/t/script-editor-can-show-the-intensity-of-used-looped-in-runs/116494/5 "2024-02-06T09:34:41Z")

</div>

I’m not at that point/level of programming… yet…

But I really like the idea behind it grylion54!!

Thanks for taking the effort to answer so extensively! maybe some other Forum members appreciate it too.
