Forum Discussion
Your approach (store the value of some string variable into table variable) should work.
It is still not clear for me what exactly does not work.
More detailed steps, screenshots, etc. may help.
Hi Alex,
In my test, when a record is registered then system will automatically generate a unique code after submission of a record. Here I am storing that generated unique code into a string variable(under Persistent Variables section). Likewise I want to register more number of records to get multiple unique codes and I have to use those codes further in my test. So please provide a suggestion that how can I do this.
Thanks & Regards,
R. Visalini.
- AlexKaras7 years agoChampion Level 3
Hi,
> I couldn't get you. Could you provide clear solution how can I do it.
Approach and the code you attached previously should work.
I'm doubting that I can provide you with something better until you let us know what exactly does not work for you.
- AlexKaras7 years agoChampion Level 3
Hi,
This is clear. What exactly does not work with your code? You wrote that no error is posted to the log, so why did you decide that the code does not work?
- visalinir7 years agoContributor
Hi Alex,
I didn't keep any code regarding this. I just gathered the innertext of the confirmation message displayed after registration of a record which also contains the system generated code into a variable and then used a VB script function to split the innertext and stored the system generated code into a string variable. Now I want to store that value into somewhere where I have to use them further. So I used table variable. Please find the attached document that I have clearly mentioned the code.
Regards,
R. Visalini
- AlexKaras7 years agoChampion Level 3
Hi,
OK... If I got the problem right...
The value of the Code variable in the UniqueCode() function is expected to be 'A301 / General sheet 1'. It was obtained as a result of splitting of the Confirmation message by ':' character.
Then the value of the Code variable is stored to the 'wsuniquecode' string project variable.
I expect that all the above works as expected.
Now, in the WorkSheetSample() function, the value of the 'wsuniquecode' string project variable is obtained and you try to split it again by ':' character. As there is no ':' character in the value of the 'wsuniquecode' string project variable, the result of the Split() function is an array with one element (and index of 0) and this array is assigned to the Code variable.
In the next line, you are trying to get the second (non-existing) element of the array (Code(1) - numbering is from zero).
This element does not exist and thus nothing is stored to the project variable.
Does my explanation help?
- visalinir7 years agoContributor
Hi Alex,
Hope you understand my issue, now forget about my code and please provide me a solution that where can I store the value in a string variable(i.e., value in 'wsuniquecode') so that I want to use it later in my keyword test.
Regards,
R. Visalini.
- AlexKaras7 years agoChampion Level 3
Within test run it is perfectly fine to use (table) temporary variables to pass data between tests.
- visalinir7 years agoContributor
Hi Alex,
I couldn't get you. Could you provide clear solution how can I do it.
Related Content
- 4 years agoLogiv
Recent Discussions
- 19 minutes agoSlickRick
- 22 minutes agoSlickRick
Name Mapping Issue
Solved3 hours agokgreger1