Is there a way to store and then use a variable froinside a map?

Tuesday, October 29, 2024
Avatar

Example.  I run a loop to create several users in my database and I get each new user's ID assigned to a variable.   Contact_id1, Contact_id2, Contact_id3

Then in my test, in another map where I am running through my test cases, I want to use the ID's from above in that map.  Example.

Test 1, 2 and 3 uses contact_id1,  test 4 uses contact_id2, etc

right now, in the map I have to set a column with some name like ID (1, 2, 3) and then inside the main test loop that calls a function, I do an IF statement to see what user I want to use using that ID column and then set that to a new variable, and then use THAT variable in the function call.

IF map ID = 1
Var contactID = contact_id1
else if map ID = 2
var contactID = contact_id2
etc

Then the function calls the variable contactID instead of a map cell

I want to be able to skip that extra step and just call the map data from the function call like I do all other fields.

Is this a possibility?  could there be a way to store a variable inside a map?

2 Replies
Wednesday, October 30, 2024
Avatar
re: anthony_damata Tuesday, October 29, 2024

Hi Anthony,

Could you please create a ticket and attach a sample test that illustrates the approach?

Regards,
Max

Wednesday, October 30, 2024
Avatar
re: inflectra.max Wednesday, October 30, 2024
inflectra.max

Hi Anthony,

Could you please create a ticket and attach a sample test that illustrates the approach?

Regards,
Max

 

 

I will do that, thank you

 

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Tuesday, October 29, 2024
  • Last Reply: Wednesday, October 30, 2024
  • Replies: 2
  • Views: 186