Forum Discussion
Hey nmrao
its not just that I need it to work anytime - the problematic bit is the fact the value has to be a 13 digit numeric text value - see required value format below
"whatevs_submissionid" : "1234567890123"
Its got to be in the above format to get passed the validation.
This has actually crossed my mind before when I was looking at inline scripting - but I didn't actually need it then so i didnt do any research.
I did have the idea of trying to use the Datasource's object's DataGenerator option - wasn't sure whether it would work - but I had a quick play around with it - but the max number of digits is 10 - I can't go beyond that - so I can't try that option (admittedly I hadn't thought out completely how I was going to use this - but I was hoping inspiration would strike!)
If it can't be done via inline scripting and I can't use the DataGenerator Datasource option - - I'm wondering if I could setup a Excel Datasource (say a 10000 row spreadsheet - incrementing a 13 digit value by +1 for each row - this would be a 10second job).
This would generate the values I need - but I'd need the test to pick up a value from the spreadsheet for each of the tests and for each execution, mark up the value as 'used' and then for the next execution pick up the next unused value from the spreadsheet as a submissionid - but thats going to take more groovy than I got - so I was hoping there's an inline option I cant find!
Essentially if I hard code this defraexp_submissionid I can't add the ReadyAPI! tests into our pipeline - cos it would require someone changing the values on a daily basis! :(
Struggling......
Cheers!
richie
- richie6 years agoCommunity Hero
- nmrao6 years agoChampion Level 3
It was mentioned in the question that the value needs to be a length of 13 characters with numbers and solution is provided accordingly.
It always generates unique( and is the main criteria) value of length 13. So you won't need to add +1 (as that is not the main criteria).
You would have come to know that if tried ( that's what I said in last message)Wrote a script(you can run it online) which does the testing of 1000 sample values and value is of 13 digit length
Since all the values passes the test, scripts ends with Success (without any assertion error).
- richie6 years agoCommunity Hero
I'm an idiot - sorry - I saw the word 'time' in the code snippet and thought - "that's not what I need!"
Apologies - I've been doing 20hours days since Wednesday and I'm making stupid mistakes
Kudos awarded :), with some extra assigned too for your patience! :)
Cheers,
richie
Related Content
Recent Discussions
- 18 days ago