Genrating @Test at run time

13 views
Skip to first unread message

akash gupta

unread,
Nov 1, 2022, 9:53:44 AM11/1/22
to testng-users
Hello guys 

How can we dynamically produce @test annotation depending on the input in one of my use cases? I tried using @dataProvider, but I was unable.

Requirement
  • We have a JSON file in which we have a  set of input parameters and output.
  • we generate all possible combinations of a given input. 
  • we want each combination should be treated as one individual test case. 
  • after performing some action with the combination set we validate the output against each combination.
How can we accomplish this? I have been unable to locate a solution, so if anybody knows, that would be helpful.

Thanks
Akash Gupta

⇜Krishnan Mahadevan⇝

unread,
Nov 2, 2022, 12:33:54 AM11/2/22
to testng...@googlegroups.com
Your use case is not entirely clear.
Are you trying to generate tests based on input, as in generate java code after reading some JSON values etc., ?

Please feel free to elaborate what you are trying to do, preferably with some sample code.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/f85f6bec-db95-416d-b66c-34c215b343c0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages