Skip to content

[Cus-7742] Added column wise iteration in tdp's#238

Merged
ManojTestsigma merged 1 commit into
devfrom
CUS-7742
Nov 12, 2025
Merged

[Cus-7742] Added column wise iteration in tdp's#238
ManojTestsigma merged 1 commit into
devfrom
CUS-7742

Conversation

@ManojTestsigma
Copy link
Copy Markdown
Contributor

@ManojTestsigma ManojTestsigma commented Oct 17, 2025

Please review this addon and publish as PUBLIC
Addon Name: Iterating through columns in TDPs
Addon account: https://jarvis.testsigma.com/ui/tenants/3072/addons
Ticket : https://testsigma.atlassian.net/browse/CUS-7742

Summary by CodeRabbit

  • New Features
    • Support for iterating through Test Data Package rows and columns in test automation workflows.
    • Retrieve complete rows from TDP datasets and store as test variables.
    • Extract and store individual column values for test data parameterization.
    • Get column count information from TDP datasets for dynamic test iterations.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 17, 2025

Walkthrough

This pull request introduces a new Testsigma addon module for iterating through columns in Test Data Platform (TDP). It includes a Maven configuration, a utility class for TDP API interactions, and four WebAction classes for managing column iteration workflows. The module supports retrieving individual columns, entire rows, and column counts from TDP datasets.

Changes

Cohort / File(s) Summary
Maven Configuration
iterating_through_columns_in_tdps/pom.xml
Defines new Maven module with groupId com.testsigma.addons, artifactId iterating_through_columns_in_tdps, version 1.0.0. Configures dependencies including testsigma-java-sdk, Selenium, Appium, Jackson, HttpClient, JUnit, and TestNG. Sets up Maven Shade Plugin for packaging and Maven Source Plugin for source attachment.
TDP API Utility
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/util/TDPApiUtil.java
Provides static methods for HTTP GET requests using Apache HttpComponents with Bearer authentication, JSON response parsing via Jackson ObjectMapper, and extraction of iteration parameter maps from TDP API responses. Includes validation for required JSON structure elements.
WebAction Classes
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetEntireRowFromTDP.java,
GetTDPColumncount.java,
SetTDpIteratorToZero.java,
StoreNextColumnTdpValue.java
Four WebAction classes enabling TDP column iteration workflows: SetTDpIteratorToZero initializes iterator to "0"; GetTDPColumncount retrieves total column count; StoreNextColumnTdpValue fetches next column value with filtering; GetEntireRowFromTDP concatenates all parameter values into comma-separated string. All map test data inputs to runtime variables and handle exceptions by returning FAILED.
Configuration
iterating_through_columns_in_tdps/src/main/resources/testsigma-sdk.properties
Adds SDK API key property for authentication.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Execution
    participant SetIter as SetTDpIteratorToZero
    participant GetCount as GetTDPColumncount
    participant StoreNext as StoreNextColumnTdpValue
    participant TDPApiUtil as TDPApiUtil
    participant TDP as TDP API

    Test->>SetIter: execute()
    SetIter->>SetIter: Set iterator to "0"
    SetIter-->>Test: SUCCESS

    Test->>GetCount: execute(tdp-id, set-name, api-key)
    GetCount->>TDPApiUtil: getTDPIterationData()
    TDPApiUtil->>TDP: HTTP GET with Bearer auth
    TDP-->>TDPApiUtil: JSON response
    TDPApiUtil->>TDPApiUtil: parseTDPResponse()
    TDPApiUtil-->>GetCount: parameter map
    GetCount->>GetCount: Store map.size() as column-count
    GetCount-->>Test: SUCCESS

    rect rgb(200, 220, 255)
    Note over Test,StoreNext: Loop: while iterator < column-count
    Test->>StoreNext: execute(tdp-id, set-name, api-key, iterator)
    StoreNext->>TDPApiUtil: getTDPIterationData()
    TDPApiUtil->>TDP: HTTP GET
    TDP-->>TDPApiUtil: JSON response
    TDPApiUtil-->>StoreNext: parameter map
    StoreNext->>StoreNext: Get nth entry, skip headers
    StoreNext->>StoreNext: Store column value & name
    StoreNext->>StoreNext: Increment iterator
    StoreNext-->>Test: SUCCESS
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

The diff introduces a self-contained new Maven module with consistent patterns across four WebAction classes. While each class has distinct logic, they share structural similarities and follow SDK conventions. The TDPApiUtil utility is straightforward HTTP/JSON handling. Review effort stems from understanding the TDP integration flow, validating error handling across multiple classes, and ensuring proper test data mapping rather than complexity density.

Suggested reviewers

  • vigneshtestsigma
  • Ganesh-Testsigma

Poem

🐰 Hops through columns, one by one,
TDP data fetched and done!
Iterator counts, rows align,
New addon flows so divine!
Test by test, the addon's spun!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "[Cus-7742] Added column wise iteration in tdp's" is directly related to the main changes in the changeset. The PR introduces new WebAction classes (GetEntireRowFromTDP, StoreNextColumnTdpValue, GetTDPColumncount) and supporting utilities specifically designed to enable column-wise iteration functionality within TDPs (Test Data Profiles), which aligns with what the title communicates. While the title includes a ticket reference that could be considered auxiliary information and has minor grammatical issues ("tdp's" should be "TDPs"), the core message clearly and specifically conveys the primary change without ambiguity.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch CUS-7742

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 16

🧹 Nitpick comments (3)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetEntireRowFromTDP.java (1)

55-76: Robust row building; avoid substring on empty.

Use StringJoiner to build the CSV safely; no trailing-comma surgery needed.

-            // 
-            String resultVariableForSToringOutput ="";
-            
-            // Loop through the parameters/columns in the parameterValues map
-            for (Map.Entry<String, String> entry : parameterValues.entrySet()) {
-                // skip the first three columns
-                
-                String key = entry.getKey();
-                if (key.equals("S.No.") || key.equals("ETF") || key.equals("Set Name")) {
-                    logger.info("Skipping column: " + key);
-                    continue;
-                }
-                else{
-                    resultVariableForSToringOutput += entry.getValue() + ", ";
-                }
-            }
-            // remove the last comma
-            resultVariableForSToringOutput = resultVariableForSToringOutput.substring(0, resultVariableForSToringOutput.length() - 2);
+            java.util.StringJoiner joiner = new java.util.StringJoiner(", ");
+            for (Map.Entry<String, String> entry : parameterValues.entrySet()) {
+                String key = entry.getKey();
+                if (key.equals("S.No.") || key.equals("ETF") || key.equals("Set Name")) {
+                    logger.info("Skipping column: " + key);
+                    continue;
+                }
+                joiner.add(entry.getValue());
+            }
+            String resultVariableForSToringOutput = joiner.toString();
iterating_through_columns_in_tdps/pom.xml (1)

37-41: Upgrade JUnit Jupiter to latest stable version compatible with Java 11.

5.8.0-M1 is pre-release; 5.14.0 is the latest stable version compatible with Java 11. Update junit.jupiter.version to 5.14.0.

iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/SetTDpIteratorToZero.java (1)

39-43: Consider whether broad exception handling is necessary.

The catch block handles all exceptions, but it's unclear what exceptions could realistically occur when setting string values on runTimeData. If no specific exceptions are expected, this defensive coding may be unnecessary. If specific exceptions are possible, consider catching them explicitly or documenting the scenarios.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b44eb4b and 58d2a65.

📒 Files selected for processing (7)
  • iterating_through_columns_in_tdps/pom.xml (1 hunks)
  • iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/util/TDPApiUtil.java (1 hunks)
  • iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetEntireRowFromTDP.java (1 hunks)
  • iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetTDPColumncount.java (1 hunks)
  • iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/SetTDpIteratorToZero.java (1 hunks)
  • iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/StoreNextColumnTdpValue.java (1 hunks)
  • iterating_through_columns_in_tdps/src/main/resources/testsigma-sdk.properties (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/StoreNextColumnTdpValue.java (3)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/util/TDPApiUtil.java (1)
  • TDPApiUtil (17-109)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetTDPColumncount.java (1)
  • Action (13-54)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/SetTDpIteratorToZero.java (1)
  • Action (11-46)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetTDPColumncount.java (2)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/util/TDPApiUtil.java (1)
  • TDPApiUtil (17-109)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/StoreNextColumnTdpValue.java (1)
  • Action (17-117)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetEntireRowFromTDP.java (3)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/util/TDPApiUtil.java (1)
  • TDPApiUtil (17-109)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetTDPColumncount.java (1)
  • Action (13-54)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/StoreNextColumnTdpValue.java (1)
  • Action (17-117)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/SetTDpIteratorToZero.java (2)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/GetTDPColumncount.java (1)
  • Action (13-54)
iterating_through_columns_in_tdps/src/main/java/com/testsigma/addons/web/StoreNextColumnTdpValue.java (1)
  • Action (17-117)
🪛 OSV Scanner (2.2.3)
iterating_through_columns_in_tdps/pom.xml

[HIGH] 1-1: com.fasterxml.jackson.core:jackson-core 2.13.0: jackson-core can throw a StackoverflowError when processing deeply nested data

(GHSA-h46c-h94j-95f3)


[HIGH] 1-1: com.fasterxml.jackson.core:jackson-databind 2.13.0: jackson-databind possible Denial of Service if using JDK serialization to serialize JsonNode

(GHSA-3x8x-79m2-3w2w)


[HIGH] 1-1: com.fasterxml.jackson.core:jackson-databind 2.13.0: Deeply nested json in jackson-databind

(GHSA-57j2-w4cx-62h2)


[HIGH] 1-1: com.fasterxml.jackson.core:jackson-databind 2.13.0: Uncontrolled Resource Consumption in Jackson-databind

(GHSA-jjjh-jjxp-wpff)


[HIGH] 1-1: com.fasterxml.jackson.core:jackson-databind 2.13.0: Uncontrolled Resource Consumption in FasterXML jackson-databind

(GHSA-rgv9-q543-rqg4)


[HIGH] 1-1: org.json:json 20160810: json stack overflow vulnerability

(GHSA-3vqj-43w4-2q58)


[HIGH] 1-1: org.json:json 20160810: Java: DoS Vulnerability in JSON-JAVA

(GHSA-4jq9-2xhw-jpx7)


[HIGH] 1-1: org.testng:testng 6.14.3: TestNG is vulnerable to Path Traversal

(GHSA-rc2q-x9mf-w3vf)

Comment thread iterating_through_columns_in_tdps/pom.xml
Comment thread iterating_through_columns_in_tdps/pom.xml
@ManojTestsigma ManojTestsigma merged commit 74d99de into dev Nov 12, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants