Add KeywordTest Parameter Count and dynamic execution via script
If you're running a keyword test via script, especially in a data driven environment where the data dictates which test to execute, it would be useful to be able to get a count of the parameters on a keyword test. Currently, for any keyword test, you have access to the Parameters object for the test and then just each parameter individually. There is not a way to iterate through those parameters and assign values prior to execution nor is there a way to simply get a count of the parameters so you can build your parameter list to pass to the Run method. It would be nice if, on a per test basis, you have access to something like KeywordTests.MyTest.Parameters.Count and even some way of iterating through the collection to set the values prior to test execution... something like going through all the parameters, setting the values, and then just executing "Run"... The idea behind this, again, is to make implementing keyword tests in a data driven framework easier. With the above changes, you can add parameter values to a keyword test in a more generic way. A framework developer could then (if the KeywordTest by name feature gets implemented), find a keyword test simply by name, assign parameter values to the keyword test straight from data without foreknowledge of the test ahead of time, and execute the keyword test. A much more generic and dynamic automation framework could be created then to integrate keyword tests more fully into a data driven structure.4.6KViews2likes4CommentsUse Enum as a Parameter type in Keyword Tests
Edit: Added a specific Use Case for clarity Like most users I use parameters for my KWTs. Some parameters have a limited option pool e.g. paramater "WantACookie" can have3 and only3 values "Yes", "No" and "Not Sure" This parameter is used to set the text of a combobox. I could create it as a string that correlates with this and each other KWT or script that calls this KWT just needs to send the string. Say, however the the marketing department decided that "Not Sure" is no longer broadcasting the right message and want to change it to "I'm Thinking About It" All those other scripts and KWTs that used to set it to "Not Sure" will break. Is it possible to create the parameter as a list of key->value pairs. That way my other KWTs and scripts can say the vaule should be WantACookie.NotSure and all I have to do is go to my KWTs WantACookie paramter and change the value of the "NotSure" key to "I'm thinking About It" You would probably have to define this KVP list in the parameter type itself I guess and when setting properties in the visual editor, this "Enum" should be available the same way Variables and Parameters are from a dropdown. Aspecific Use Case: The Enum is a way to define a limited amount of set options that you know won't change Say I'm an e-commerce site. I wan't to make sure users don't have a bad experience by accidentally buying something when they intended to just add it to the wish list. Three tests: 1. Textbox1.Keys()->Textbox2.Keys(),texbox3.Keys,etc,-> buttonPlaceOrder.Click() -> Open Wishlist page -> Are ther items ? No -> Pass -> Open Basket -> Are there items? Yes ->Pass 2. Textbox1.Keys()->Textbox2.Keys(),texbox3.Keys,etc,-> buttonAddWishList.Click() -> Open Wishlist page -> Are ther items ? Yes -> Pass -> Open Basket -> Are there items? No ->Pass 3. Textbox1.Keys()->Textbox2.Keys(),texbox3.Keys,etc,-> buttonCance.Click()l -> Open Wishlist page -> Are ther items ? No -> Pass -> Open Basket -> Are there items? No ->Pass All three tests have the data populate in common. I don't really care what data is in there and I won't use it in a Data Loop so it can all be the same and be written into a single test so I don't have to duplicate all those .Keys() and .Clicks() into all my KWTs So, create one KWT PopulateOrder that does the keypresses. One step further I can see the only thing that distinguishes the process is what button gets clicked. If I specify this as a parameter like PopulateOrder(OrderAction) I can change my tests to this by simply dragging the new KWT into my visualiser : 1. PopulateOrder(Order) -> Open Wishlist page -> Are ther items ? No -> Pass -> Open Basket -> Are there items? Yes ->Pass 2. PopulateOrder(WishList) -> Open Wishlist page -> Are ther items ? Yes -> Pass -> Open Basket -> Are there items? No ->Pass 3. PopulateOrder(Cancel)->Open Wishlist page -> Are ther items ? No -> Pass -> Open Basket -> Are there items? No ->Pass The last steps in my Populate order is an if statement: If(OrderAction equals "Order"){buttonPlaceOrder.Click()} If(OrderAction equals "WishList"){buttonAddWishList.Click()} If(OrderAction equals "Cancel"){buttonCancel.Click()} If I drag the KWT into another KWT I can supply this parameter. Problem is, if a user doesn't know the exact string required and they type in, say "PlaceOrder", the KWT will fail because none of the if statements match. If on the other hand I can define the parameter as an enum that the user can choose from a dropdown I know the logic will always work e.g. if(OrderAction equuals OrderActionEnum.Order) {buttonPlaceOrder.Click()} It's something I would really have appreciated when I started using TC. It would have helped standardise my tests by always having the option based parameters defined, thereby avoiding loads of rework due to early inexperience. It still helps because I wouldn't have to open the PopulateOrder just to double check what string I need to send.4.4KViews2likes8CommentsRun A KeywordTest by name
Runner.CallMethod works pretty well with regards to running Keyword tests. You can do a syntax like: Runner.CallMethod('KeywordTests.TestName.Run', 'parametervalue'); However, this is a bit clunky to me. First of all, if you don't have the name up front but want to parameterize this call, you would need to do a concatenated string for the object name. Secondly, this just seems to be a bit out of the way. Code Completion already knows all the tests associated with the KeywordTests object so the information is already there. It would be nice to do something like KeywordTests.TestByName('MyTest').Run('parametervalue'); This just seems more intuitive and lends itself to a much cleaner implementation for creating a framework around the tests. Note that I'd prefer the keyword test to be returned by name so that we have access to things like Test.Variables and Test.Parameters (see my other ideas on KeywordTests).3.4KViews3likes3CommentsEnter multiple lines into Description column of keyword test editor.
If this feature is available, I do not know how to do it. It would very helpful to be able to enter multi-line text content into the Description column of the keyword test editor. Our convention for documentation is to write something meaningful to a human operator of the software application being tested for each step such that a manual test can be performed to mimmick the keyword test. The problem is, there is no wrap-around on this column, nor is there an ability to enter a carriage return directly into the editor. We have a workaround, which is to write the text into Notepad (with carriage returns) and cut and paste from Notepad into the Description cell. This is very cumbersome at best. As far asI can tell, the Description column appears to be the place to do line-by-line comments (we prefer to use the Comment line in keyword tests for higher-level documentation). We like the line-by-line commenting because we have a in-house program that will pull out the Description content from keyword tests and write them to a text file, thus giving us a manual test procedure for a diagnostician to run when we encounter bugs.2.9KViews0likes11Commentsdisable project tree expansion
everytime you open a keywordtest the project tree jumps to its location. if you have many many items in your tree it can be really annoying because you have to scroll and scroll. would be nice to have an option to disable the automatic behavior and use manual expansion (if needed).2.9KViews5likes3CommentsKeyword test clean-up/post-conditions
It would useful to be able to define clean-up steps/post-conditions for keyword tests. This could be implemented as a new test step section at the bottom that always gets called regardless of whether the main test failed or not. The test would still be reported as having failed in the test results, but before moving onto the next test it calls the clean up steps. I know that you could implement this as a separate test that gets called after the main test in the test project, but that's a pain if multiple tests have the same clean-up steps. Having explicit clean-up steps makes it easier to understand what the test does just by looking at it, and how it might affect the rest system and subsequent tests if it fails early. I tried using the Try ... Finally keyword test steps but the Finally step isn't called when an error-level message is logged. Maybe we need to be able to raise exceptions from keyword tests instead of using Log Error Message, so the Finally step is still called.1.9KViews0likes4Comments