Create your first automation in just a few minutes.Try Studio Web →
by Stefan Krsmanovic
3
Solution
16.3k
Hi Stefan,
I downloaded your latest version of the above testing framework. so, while executing i am getting error regarding "Get test locations ui " activity which is under package TestingFrameworkUI v1.3.3 . Earlier the same file was working fine till last week but from yesterday we are unable to run this file due to the below error
Error details is as follows:
Source: Get test locations ui
Message: Could not load file or assembly 'WPFUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Exception Type: System.IO.FileNotFoundException
RemoteException wrapping System.IO.FileNotFoundException: Could not load file or assembly 'WPFUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at TestingFrameworkUi.GetTestLocationsUi.OpenSelectTestsWindow(String rootFolderPath, String projectName, SortedDictionary`2 testRunInformation, Dictionary`2 expandedItems, Dictionary`2 windowInformation)
at TestingFrameworkUi.GetTestLocationsUi.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.InvokeWorkflowFile.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
My Studio version is studio 2020.10.2 enterprise edition however its working in community version of studio 2020.10.6
Thanks in advance for your response.
Hi Stefan,
Is it possible to generate the logs in excel format rather than the notepad
Hello Vamsi,
By default it is not supported. You would need to modify the framework to change the output format.
But is a good idea for the framework update to allow different outputs of the logs.
If this is urgent requirement, I think you can relatively easy make regex parser for each line of text and writes it in excel.
Nice Framework its help me lot. I am struggling to execute from Orchestrator. please assist me to execute from Orchestrator QUEUES and suggest me how to utilise this framework for Regression Test packs.
Nice Framework its help me lot. I am struggling to execute from Orchestrator. please assist me to execute from Orchestrator QUEUES and suggest me how to utilise this framework for Regression Test packs.
Hello, there is no possibility to run the framework v2 from the Orchestrator because it has GUI (My intention for framework was that the devs run the Unit/Functional tests from the GUI manually). But what you can do is to download the older framework v1 (from View version history button) or modify the framework v2 so that it doesn't use the GUI. Regarding regression testing framework GUI has option to run all tests 1 by 1. But if you need more control you will need to modify the framework to suit your specific needs.
Hi there,
Is this project actively maintained do you plan to do so in the future?
Thanks?
Hello,
Sorry for the late reply.
Project is semi-actively maintained.
Currently only if some bug fix is needed. At the moment no feature is developed, because of low amount of free time.
Cheers
Hello!
In this framework,
For example, can the button on the browser be checked with the Click activity to see if it succeeded?
I want to know that.
Thank you.
Hello,
Yes, you can write test that checks if click was successful or not.
You develop tests like you develop your production code. So it all rests on you to make it work.
Framework just helps you run the tests. Whether they are unit test or functional tests it doesn't matter.
Cheers
hi Stefan, ima unable to access the PDF attached under Resources tab. Could you please provide any alternative link?...or send it to my mail ID....rameshgp43@gmail.com
Thank you
Hello Ramesh,
Hmm, I can open the pdf just fine.
Well, you can find the same information here https://devpost.com/software/uipath-testing_framework
Best regards,
Stefan
Have you come up with a good way to mock activities in tests? For example let's say I have an Add Queue Item activity in a workflow file. There's logic in that activity that will output certain argument values if the Add Queue Item activity succeeds vs if it throws an exception. I want to mock that activity in my unit test to control what happens.
Have you run into a similar issue? Mocking is very common in unit testing so this strikes me as something that's needed in a test framework.
Hello,
It is hard to do in UiPath as workflows don't have a concept of Interfaces like regular OOP languages do.
But I have a workaround in mind. A way to simulate "dependency inversion", Although I am not sure we could still call this a unit test with this workaround.
It seems I cannot make 2 replies, and I have a character limit, so it is a bit hard to explain it shortly, but I will try.
It involves encapsulating Add QueueItem activity inside of workflow (WF1), making dummy workflow that takes same arguments as WF1 (WF2). Original workflow would have to have in_Argument that would represent a path to the WF1 in case of prod or WF2 in case of unit test.
Original workflow instead of AddQueueItem actiivty, just uses InvokeWorkflowFile activity that takes in_Argument as a path. Also InvokeWorkflowFile activity has to have same arguments as WF1 and WF2.
If this sounds confusing, please send me your email, and I will send you an example of what I meant.
Preface: I really like the effort and structure but holding off on a review to make sure I understand some contexts. Please treat below as wanting to see it get better. The test runner itself looks nice, but it also does contain some things I truly don't agree with, so to be fair I'm posting this as a question instead of review to not skew the rating simply because maybe I'm missing some context. Main gripe is that by definition UnitTests must be self contained. In all of the examples and in the guide, you've omitted the Teardown phase completely. Due to that in NavigateToReddit example -> on failure window will stay open which may lead to other tests giving FalsePositive/FalseNegative results. Yes, it's an example, but it should even more stress how to write the test correctly. Second thing that stroke me was that in all of the examples the tested code is directly in the test (instead of invokes), which may lead people to believe that that's ok, while in reality it leads to desynchronization between tests and "real" code. Again, I know these are just examples, but since the framework and guide describe HOW to write UnitTests, it is relevant to not give bad example which people may build upon. A simple info that "In real tests _always_ use invokes to workflows under test" would be a good start if you don't have time to create examples with invokes. Next, there are some things in the Assert package that are, to me, confusing. Firstly - it contains Newtonsoft.Json directly instead of referencing it as a dependency for the package, which leads to size bloat and may lead to version conflicts. Secondly - there are .AreEqual and .AreSame implementations. At first I thought (since the methods don't contain XML comments - would be nice to have as well) "Ok, equal is a value comparison, same is a reference comparison, makes sense". But then in the examples string equality is checked using .AreSame (Strings are special, but they're still ref types even if behaving like value types most of the time). Could you clear this out? I might be missing something. Thirdly - AssertException, AssertNullException and CustomAssertException do not share a common base class. If you look at exceptions inheritance hierarchy in .Net a more specific exception always inherits from a more generic one, up to System.Exception. While this probably won't become an issue if using the framework as-is, it does seem to be an omission that could bite down the line. Fourthly - Assert class seems to be just a container for static methods, but is not static itself. For the documentation/guide: "For Framework to consider a Unit Test as valid, it must implement Assert Unit Test activity" That's nitpicking ;), but a workflow xaml does not implement an activity, it has one (is-a / has-a distinction). Your check is also xaml text based, which I also get why is like that, but ironically the ValidateTestFile.xaml also passes as valid unit test. Probably won't be a concern, but that's a possible issue. Sidenote - Why rolling your own Assert class? I admire the effort, but still - there are well tested and constantly supported libraries (MS UnitTesting framework, NUnit etc.). Or even use the built-in CheckTrue/False (they would provide same functionality as they throw CheckpointExceptions). Yes, the checks with need to be more specific with Check*, but "flexible" asserts seem dangerous (see above for value/ref comparison). It's also missing one of the IMHO most important things for UiPath testing - Assert.ThrowsException.
Hello,
First I'd like to thank you for the detailed review.
There are many valid points that you have mentioned and that can and should be improved upon.
I will just answer you the points a don't agree with or want to clarify.
Point about the test examples is that I would have to distribute test project to show how invokes work, and my decision was not to go that route. That is why video exists to show how it actually is supposed to be done and also test template shows this. And I also think that annotations describe this pretty well.
For xml comments, they do exist, but UiPath is not showing them, but I probably should have aded them to the guide document. For strings both comparisons will work (and I do believe this is how it works in all test frameworks that you have mentioned).
Forth point is my bad. Truthfully, I didn't even notice I left it that way. In code it acts like it is static class, because all methods are static (I never instantiate it as an object), so it kinda didn't matter in this case. Will change it tho. Thanks :)
About why I didn't use already available frameworks. It is because some methods that are there would not be applicable to the UiPath (like Assert.ThrowsExcepton that you have mentioned). But I see your point.
Regarding that last part was hardest for me to came up with at the time. But I got some ideas how I would implement that now (still not sure if it is possible, but seems it is).
Once again thanks for reaching out, I really appreciate all the feedback :)
License & Privacy
MIT
Privacy Terms
Technical
Version
2.0.1Updated
June 15, 2023Works with
Studio: 21.10 - 22.10
Certification
Silver Certified
Collections
Support
UiPath Community Support
Resources