I was just learning UiPath (the UiDemo practice example) and was playing with the nice test framework they created in the REF. One of the workflows (Process) I wanted to test required a TransactionItem(QueueItem) as an “in argument”.
I didn’t want to have to use an Orchestrator queue just for this in my test harness workflow.
I really only needed to start my app up, log into the app, and pass in a transaction before I called “Process”. I also wanted to create tests with different TransactionItem SpecificContent. I noticed there were some questions from other users about being able to create TransactionItems somewhat like this so I thought I would just post. UiPath pros can correct this as necessary.
In any case I did the following in my “Process” related test workflows:
Created a empty queue item
image
704×482 13.2 KB
Invoked some code to add the SpecificContent dictionary and associated values. My values were being fed from variables I could change.
image
876×333 28.2 KB
image
748×508 35.8 KB
That was all I needed for my transaction and test workflow…
What you are doing can be very useful to test the Process layer when it expects a queue Item as input.
Would be interesting to submit this to GO as a reusable component taking as argument a dictionary and returning a queue item.
Want to let the world know about yourself and your RPA Experience? Update your new UiPath profile. Remember: Be smart, be fun, be innovative!
Interested in becoming a Contributor? Follow this
link
), it will redirect you to your profile to perform necessary updates required to upload content on the Go!
Note: Some components have not been associated with the right authors/owners - this is because the authors …
Cheers
Hello!
I got a Validation Error when initialise Dictionary: Cannot assign from type ‘System.Collections.Generic.Dictionary`2[System.String,System.Object]’ to type ‘UiPath.Core.QueueItem’ in Assign activity ‘Assign’.
Can anyone send an update what should I do?
Thanks in advance!
By putting the following in arguments tab as default value for transaction item:
New QueueItem With
.SpecificContent = New Dictionary(Of String, Object) From
{"folderPath", "C:\Users\"},
{"templateType", "locationChange"}
you won’t need to add additional Assign or Invoke Code activities that you need to toggle on or off whenever you need QueueItem mocked. obraz1193×569 23.5 KB
May as well just do it in a one liner assigning (after initializing New QueueItem), this is how I am testing with “debug file” instead of “debug”, so I am not running the main.xaml just the workflow process.xaml, with my fake data (so it’s not consuming my queue):
image1138×411 22.8 KB
Log In using your UiPath Account to:
• get help with your automation projects • share feedback, report bugs or just drop us any question • become an MVP and get access to exclusive events • save your user preferences like themes and more • automatically sign in to other services • get in touch with our Forum staff