System generated order number

Ask general questions here.
alina
Posts: 10
Joined: Wed Oct 15, 2014 5:03 pm

System generated order number

Post by alina » Mon Oct 27, 2014 1:21 pm

Hi,

I need some help.
Basically I am auomaing a system that generates orders. Order numbers are randomy generated by the system.

I would like to :
1) create the order,
2) On saving the order, a random order no. is generated by the system.
3) Save that ordernumber (maybe save it in an xternal file)
4) Read from that external file (the order no) and enter it in the system to view it.

Could anyone tell me how to do this efficiently.

Thanks,

Alina

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: System generated order number

Post by krstcs » Mon Oct 27, 2014 2:22 pm

If you can do it all in the same test, the best way would be to use a Global Parameter and store the value in it using the GetValue() action.

TestPart1 (value is generated)
...
StoreValue (using GetValue and binding the module variable to the Global Param)
...
TestPart2 (use the value)


If you haven't already, I would suggest reading the user guide here. It has a lot of information that might be useful.
Shortcuts usually aren't...

alina
Posts: 10
Joined: Wed Oct 15, 2014 5:03 pm

Re: System generated order number

Post by alina » Mon Oct 27, 2014 3:57 pm

hI,

I am looking for a quick and dirty fix that will do that. Is there a specific page in the manual that has this topic? the reason i ask, is because I have time pressures and unfortunately, due to this, i am unable to undego any tutorials/training.

Is there anything similar anyone has done that can help?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: System generated order number

Post by krstcs » Mon Oct 27, 2014 4:25 pm

What I gave you was the "quick and dirty" fix.

Not knowing your AUT or your existing test solution, it is very hard to go any further than what I have given you, especially if you don't have time to learn Ranorex in order to understand the solutions that are presented.

From my experience, if you don't have time to read the manual and work with the product, I would suggest that you do not have time for automation. Automation is not a quick fix for not having time to thoroughly test an application. Automation requires MUCH more up-front time than manual testing and should be scheduled accordingly. Automation is a software development project just like building a website or app, and should be approached with the same planning and scheduling.

Once you learn the system and tools, there are ways to speed up the development, but it requires a thorough understanding of what is involved and a lot of experience automating with the toolset.
Shortcuts usually aren't...

alina
Posts: 10
Joined: Wed Oct 15, 2014 5:03 pm

Re: System generated order number

Post by alina » Tue Oct 28, 2014 11:23 am

Thanks for your reply.
you are absolutely right, I am quite new to Ranorex, though I have done Automation using VS Coded UI before.

OK, so comin back to the original question, using the GetValue action, I have got the Order reference number.
This has been allocated to a module level variable; which is bound to a Global Parameter.

Question is, how do i read the value from the variable, as i need to read the reference in order to enter it in the search.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: System generated order number

Post by krstcs » Tue Oct 28, 2014 3:24 pm

OK, so, all you have to do now is re-bind that Global Parameter to another module's variable and the updated value will be present. The sequence of "events" looks like this:

1. Create Global (or test-case) Param X
2. Create GET module with variable X.
3. Create Report module with variable X.
4. Put GET-X in test suite and bind X to X (autobind is your friend, always name the variables and data sources or parameters the same so autobind can work for you)
5. Put Report-X in test suite AFTER GET-X and bind X to X.

Now, X will get set in GET and used in Report.

Parameter values (both global level and test case level) are automatically updated when you set their values, so every module that uses them after they are set will see the new value. Note that you may want to CLEAR the value after each use, just in case. Parameters are essentially just global variables (or test-case variables).

Also, Global parameters can be set at runtime through the command line, so you can use them to set runtime parameters like test ENVIRONMENT and CONFIG settings.
Shortcuts usually aren't...

alina
Posts: 10
Joined: Wed Oct 15, 2014 5:03 pm

Re: System generated order number

Post by alina » Tue Oct 28, 2014 4:02 pm

Thanks so much, that helped.

All the best,

Alina