Contributions
Re: Non-standard ways of using TestComplete for building test cases
Hi all and thanks for your replies. Both baxatobandtristaanogregot exactly the point and just made my life a lot easier! tristaanogreyou lost me a bit here: tristaanogre wrote: It is actually one step away from going with something more data-driven in a framework where your data consists of the scenarios and the test "steps" to be executed and then you run a driver to read the data and execute the steps based upon the data source. Changing a test case in that type of setup is then simply a matter of adjusting the data to reflect the desired changes. Adding a test case is simply adding new rows to your data and so on. Code wise, it makes the most sense to have a function for each step and then one function to read data to execute those steps in a configured order. Code is reduced by an exponential factor and your primary maintenance for test cases is data entry and your code maintenance is simply maintaining your step-functions as your application and testing needs change. I'm starting today turning those functions into modules and calling them. I though this was closer to a bad practice rather than a good one. Thank you again for this massive game changer for me. Marsha_RYes you got it right. It was on the go and to make it very obvious to anybody reading the post what was the intention behind. I'll try and come with a better name next time.4.3KViews1like2CommentsNon-standard ways of using TestComplete for building test cases
Hi all, I'm working on this concept to make use of TestComplete in a different way. Instead of adding test cases, steps to those test cases inside my project I'd like to have one "step" per test case so for example if I was testing a login system and I had three test cases (just an example but you'll see): 1. Open app, enter no credentials, click login. Expected result: no login, error message. 2. Open app, enter wrong credentials, click login. Expected result: no login, different error message. 3. Open app, enter credentials, click login. Expected result: userlogin. User lands on user dashboard. Right? Well... using TestComplete as it's supposed I'd create one script for launching the app, another for dealing with TextBoxes (entering text as parameter), another for clicking in buttons (Login, Cancel), another for checking error messages when necessary and so on. Right? What if I had only one routine call per test case as this in my project? Test Login: 1. Test login case 1 function TestCase1() { OpenApp(MyApp); EnterCredentials("",""); ClickLoginButton(); CheckErrorMessage("Invalid Username or Password"); } 2. Test login case 2 function TestCase2() { OpenApp(MyApp); EnterCredentials("1234","1234"); ClickLoginButton(); CheckErrorMessage("Invalid Password for user 1234"); } 3. Test login case 3 function TestCase3() { OpenApp(MyApp); EnterCredentials("1234","4321"); ClickLoginButton(); CheckUserHasLoggedIn("Welcome back! Last login 16.12.2016 at 16:10pm"); } So in that case I'd be calling one function and each function would call the right functions every time. As I see it the benefit would be not having to maintain the test cases steps in my project but only those functions. I have to say that I'm a lot faster using the keyboard than clicking and selecting, etc. So this would allow me to build test cases much faster. The question is: does this kind of usage have any penalties as memory consumption, logging issues or anything that is really undesirable? Isn't it a faster, more robust way of coding my test cases? Considering the time it takes to build a test case the traditional way, the lack of supportfor copying test cases between projects (even within the same project).... wouldn't this solve those issues? I'd like to hear your ideas and any other "non-standard" way of Using TestComplete. Specially those that make you life easier and your testings more accurate/faster. Much appreciated, LeoSolved4.4KViews2likes7CommentsRe: TestComplete integration with TestRail
Hi schef, joseph_michaud and Colin_McCrae, Found the source of the problem thanks to schef's last reply and it has nothing to do with schef's scripts. TestRail address was incorrect although that wasn't the only problem. Also TestRail has an awkward way to reference test cases in a test run. Using the method add_result_for_case passing runId and caseId it's a bit tricky as the caseId in this case is the test case number (C) not the Test (T) from the test run. Yes as complicated as it sounds that's the source of the problem. So basically TestRail references a test case in a run using RunId + CaseId instead of RunId + TestId (which is generated for each test run). Thank you all for the good effort and support as it would have been impossible to get it working without you. Much appreciated. Cheers, Leo5KViews3likes2CommentsRe: TestComplete integration with TestRail
Hi Colin, Fromthe original usage post I'm trying the simplest one "retestCase" which has no comments, no version, only test run and test case numbers as explained in the post. //USEUNIT TestRail function testUpdateTestRail() { testrail.retestCase(4683, 866867); testrail.passCase(4683, 866868, {version: 'Build 10.0.0.1234'}); testrail.blockedCase(4683, 866869, {comment: 'Blocked due to JIRA-4321'}); testrail.failCase(4683, 866870, {comment: 'Failed. JIRA-5678 logged.', version: 'Build 10.0.0.1234'}); }5.1KViews0likes1CommentRe: TestComplete integration with TestRail
Hi Colin, Thanks again for taking time to reply. There's no paths involved here. If you look the function I'm calling: function testUpdateTestRail() { testrail.retestCase(13, 3486); } has only two parameters on it. Test run and Test case number both hardcoded integers just for testing the connection between TestComplete and TestRail. If you follow the scripts posted by schef you'll see there's no file paths either. On the other hand... how do I get to see the Json being sent.... no idea and it'd be great to know even for future debugging. Cheers, Leandro5.1KViews0likes3CommentsRe: TestComplete integration with TestRail
Apparently there's an error when parsing the request. So what I did is compiling the testrail integrationwith donNET Gurock.TestRail includingJson90 library. Then added the resulting dlls to the CLR Bridge using 64-bits architecture/appartment model = 'Does not matter' (as it seems to be the right thing to do although I'm not sure) Then calling the function where parameters are correct and meaning (testRun, testCaseNumber): function testUpdateTestRail() { testrail.retestCase(13, 3486); } The error is what you see in the image.... Any clues/suggestions? I guess the real question would be if CLR has been added correctly, which I assume yes as I can see the dotNET routines when typing and why isn't parsing Json correctly and how to debug it. Thank you7.3KViews0likes5CommentsRe: TestComplete integration with TestRail
Hi Colin, Thank you for your reply. Yes I downloaded the API binding and the Json.NET dependency. I managed to build the project including that dependency. Now I guess the only part missing would be making TestComplete use it. I'll investigate the link and hopefully will work in the end. Thanks again!7.3KViews0likes1CommentRe: TestComplete integration with TestRail
Can I please get more information on how to get the library going? Specially the notes in the script can you clarify the steps to do it? // Note: this functionality depends on 3rd party .NET libraries that needed to be compiled by you. We downloaded the testrail .NET api bindings // from the testrail website, along with the Json.NET library. Using visual Studio 2010, we built the Gurock.TestRail library, referencing the Newtonsoft.Json // library. We built x86 and x64 versions using .NET 3.5. In this project, the libraries are stored in a folder next to the project, and have // already been linked to the project via the CLR bridge. Thank you7.4KViews0likes9Comments