Hero Background

Power Your Software Testing with AI Agents and Cloud

The Native AI-Agentic Cloud Platform to Supercharge Quality Engineering. Test Intelligently and Ship Faster.

Kane CLITrading

Test a GTT trigger and the rule that validates it

A buy trigger above the market price is nonsense. Four steps check the rule is enforced before the valid trigger is created.

Published on:

A good till triggered order sits waiting for a price, sometimes for months. Because nobody watches it, the validation at creation time is the only opportunity to catch a trigger that can never fire sensibly.

This use case creates a GTT on the Zerodhaa Kyte clone and checks the rule that guards it.

The checks that matter

The rule under test is directional: a buy trigger has to sit below the current price, because a buy trigger above it would fire immediately and defeat the purpose.

AttemptTriggerExpected outcome
Invalid buy trigger1,600 against an LTP of 1,530.40Refused, with the rule stated
Valid buy trigger1,450 against the same LTPAccepted and listed as active

Testing the refusal first is what proves the validation exists. A GTT created successfully tells you nothing about whether a nonsensical one would also have been created.

Note

Note: Checking a directional rule from both sides costs one extra step and covers the case a long-lived order cannot recover from. Start on TestMu AI. Start for free

The flow as a test file

The last traded price is asserted first, so both the invalid and valid triggers are demonstrably on the sides of it that the test intends.

---
mode: testing
url: https://my-testing-repo-main.vercel.app/zerodha-clone-app/gtt?reset=true
max_steps: 45
tags: [zerodha, fintech, orders]
---

# Zerodhaa Kyte 17.2: GTT trigger

Catalog objective: create a GTT with a trigger and a limit price.
Key assertion: the GTT is listed as active with the correct values.

## Verify the last traded price
With "RELIANCE" selected and "BUY" chosen, verify "Last traded price" reads "₹1,530.40".

## Verify a trigger on the wrong side is refused
Type "1600" into "Trigger price", "1605" into "Limit price", "5" into "Quantity", click "Create GTT", and verify an error says that for a buy GTT the trigger must be below the LTP of ₹1,530.40.

## Create a valid GTT
Replace "Trigger price" with "1450" and "Limit price" with "1455", then click "Create GTT".

## Verify the GTT is active with the right values
Verify a green banner titled "GTT created" names "GTT-1" as BUY 5 RELIANCE when the price hits "₹1,450.00" with a limit of "₹1,455.00", and the active GTT list shows that row with an "Active" badge.

The final assertion names the direction, the quantity, the instrument, the trigger and the limit, because a GTT that stores any one of those incorrectly executes a trade nobody asked for.

Step by step coverage

A baseline, a refusal, a creation and a record.

StepWhat it proves
Verify the last traded priceThe reference price both triggers are judged against
Verify a trigger on the wrong side is refusedThe directional rule is enforced with an explanatory error
Create a valid GTTA correctly placed trigger is accepted
Verify the GTT is active with the right valuesDirection, quantity, instrument, trigger and limit are all stored

Both the confirmation banner and the active list are asserted. A GTT confirmed but absent from the list is an order the client believes exists and cannot manage.

Next-generation test execution with TestMu AI

Adding it to a suite

kane-cli testmd run tests/zerodha/gtt-trigger_test.md

Add the sell side, where the rule inverts and the trigger has to sit above the last traded price.

Conditional orders persist far longer than the release that created them. Evidence based QA covers retaining proof, and generating the inverse case covers producing the sell variant from the same description.

Author

...

Bhawana

Blogs: 75

  • Twitter
  • Linkedin

Bhawana is a Community Evangelist at TestMu AI with over 3 years of experience creating technically accurate, strategy-driven content in software testing. She has authored 50+ blogs on test automation, cross-browser testing, mobile testing, and real device testing. She also serves as Product Marketing Manager for Kane CLI, the command-line tool that runs browser automation from the terminal using natural-language flows in a real Chrome browser. Bhawana is certified in KaneAI, Selenium, Appium, Playwright, and Cypress, reflecting her hands-on knowledge of modern automation practices. On LinkedIn, she is followed by 6000+ QA engineers, testers, AI automation testers, and tech leaders.

Add to Google preferred sources

Summarise with AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

GTT Trigger FAQs

Did you find this page helpful?

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests