ContributionsMost RecentMost LikesSolutionsRe: workaround converting pdf to txt What is the PDF opening in? I just tried it. My Win 7 setup isn't setup for PDF files in any special way. I just dumped one in there and opened it. It decided to open it with Chrome. TestComplete complained that it couldn't see the internals of the PDF application within Chrome properly. But it was able to click it OK. (To put it in focus) And send it "keys" of "^a^c" (CTRL+A, CTRL+C). After that, the full text content of the documents was in sys.clipboard as expected. Re: How to automate the process of Restoring the snap shot on VM using TestComplete or Win Batch File? Never done it myself ... But I suspect you'll want to be making use of the tools VMware supply for doing this. So either: https://code.vmware.com/web/dp/sdk/55/vsphere-cli Or: https://communities.vmware.com/community/vmtn/automationtools/powercli They also provide a Perl SDK, but I suspect that won't be what you're after. PowerShell is likely to be the easiest option for a simple restore from snapshot. TestComplete is fine with running PowerShell scripts. See here: https://support.smartbear.com/testcomplete/docs/testing-with/advanced/using-external-functions/running-powershell-scripts.html Re: random number Just to add to baxatob's reply re. Python random numbers .... randint (his example) is inclusive. So will return a random integer from 0-9 (including 0 and 9). So, technically, "between" isn't quite accurate. Also, you probably want to seed it. (Which is what the "randomize" statement in the VB version does.) In Python, use "random.seed()" (in this form - with no value passed in - it will use current time as the seed) to avoid getting the same sequence of (pseudo) random numbers every time. See here: http://stackoverflow.com/questions/22639587/random-seed-what-does-it-do - if you want an explanation. Re: workaround converting pdf to txt Assuming you can load the PDF OK, and TC can "see it" (so at least can interact with it on the most basic level), and it's not a protected PDF (you'll need a third party bolt-on for those) .... You can simply click it to give it focus, then send it keyboard shortcuts (CTRL A then CTRL C) which will select all text and dump it into the clipboard. Then just take the clipboard content into a string in your script and do whatever you need to do with it. This only gets raw text. No images. No formatting. But if it's just the text you need, it's a simple and effective solution. I've used it many time for validating document content, in the same way you'd screen scrape from an application. Re: Why no Object repository in TestComplete I have an application with 70 screens and more than 4000 objects But how many of these are actually relevant to the tests you'll write? This is where the Alias map comes in. By all means, map everything (automatically if you're willing to risk it). But do spend a little time creating a more human readable version of the important parts (mainly the bits your code will interact with the most) in your Alias map, and leaving out all the containers etc which need to be there, but don't really form part of the test itself. A good Alias map makes maintenance and general use of objects on an ongoing basis massively easier. Just saying (again), as it's one of the most common mistakes I see on here -using big horrible unreadable copies of map objects in the Alias tree ..... yuk. Re: Why no Object repository in TestComplete There are various options for configuring and using automatic mapping/capture. But I don't really use them. I've been stung by automatic mapping often enough over the years that I just prefer to do it manually now. Takes a little longer up front obviously, but at least I know my references should be rock solid so pays off down the line. And you should find everything you need to know starting from here: https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/overview.html ** EDIT ** tristaanogre.... lol .... Snap! :smileylol: Re: Why no Object repository in TestComplete Given your calling it an "Object Repository", I assume you're coming from a QTPro/UFT background? I was the same. The Name Mapping in TestComplete is a little different to the Object Repo in QTPro/UFT, but is used in much the same way. What I will say, as you are new to it and this will save you headaches further down the line, is make sure you understand the difference between the full Name Map and the Alias Map. If your Alias Map is a straight copy of your Name Map, you're doing it wrong. The Alias Map should be a subset of the Name Map. And it should cut out the parts of the application you aren't really interested in (usually series of container panels and frames used to build the page structure). Aliases should also be renamed to be as humanly readable as possible. So your full Name Map will be a large, technical looking, map of the ENTIRE application. It will have LOTS of layers, be tricky to read unless you do a LOT of renaming, and will be big - as it will contain EVERYTHING. (It has to) But your Alias Map should be much more readable, smaller, and more like a representation of the application as the user sees it, without all the irrelevant container object they don't care about. Once you get this worked out and set up properly, it makes using Aliases in you code much more pleasant. Italso makes changes to application structure much more manageable. If a few containers change, but the buttons at the end of it do, simply correct the name map and the Alias will continue to work just as it always did. If you find yourself having to update both as a result of container change, in my opinion, your setup is wrong. You can also use multiple copies of a single Name Map item in the Alias Map, renamed so they "look" different. I commonly do this with container frames which, as far as the user is concerned, are distinct and different panels, but in the background, they actually aren't. But it makes more sense in the Alias Map if they look that way. And to add to what tristaanogrehas already said, yes you can map items using a tool in TC. But, as with QTPro/UFT, expect to have to pay a bit a bit of attention to the properties used and make manual modifications where required if you want things to be reliable long term. It's seldom 100% reliable to use automatic identification properties all the time. Re: Publish TC results to Visual Studio Online I can add a little more to this. Obviously, TFS is not static. As your project evolves, things advance in TFS. But at the same time, you don't want to be constantly updating your tests with hundreds of new identifiers every time you run it. In our use case, the regression test suite is copied forward each time a new sprint is started. A sprint is a "plan" in TFS land. So our structure is: Project > Plan > Suite > Test My config file contains the following configuration options and is read once at the start of the run: TFS Active - Boolean flag to say whether the run is using TFS. We don't always want to. Authorisation - Authorisation token allowing the connection via the API. TFS has a couple of options for how you Auth. Project - The ID (or name) of the project to use. Plan - The ID (or name) of the plan to use. API version - The currently installed version of the API. This gets bolted to the end of requests to the API. Not required, but TFS states it's best practice to do it. So I do. These bits do require updating, but infrequently. And they are single entries in config. So it's manageable. Then within my test "packs" (I use my a data + keyword driven framework), there are references to: Suite - The Suite NAME to use. Name is used rather than ID as it doesn't change when the whole lot is copied forward in the next sprint (Plan in TFS land - see above). Given when a new suite comes into use. Can change multiple times throughout one of my test "packs" if need be. But usually only set once at the start as tests within a "pack" tend to be logically grouped in much the same way as they are within TFS. Test - The ID of the test Item within the Suite. Given along with a "start" flag. Ended using an "end" flag (as multiple steps within a TC test "pack" tend to form a single TFS test. They are seldom single step entities in my setup). These entries should not require updating. The only time they do is if someone (annoyingly) changes the name of a test Suite. When it starts a suite, it searches the current Plan for a suite of that name. It then finds all the test Items (as TFS refers to them) within the suite. Each test Item contains a reference to the original test ID. You need to scan through them to link the Item to the original Test, and hence to the entry on my test "pack". You can't use the Item ID as it changes every time you copy the Suite forwards and you would have to update every single individual test. Not practical. Obviously. Suites are referenced by name for similar reasons. The name doesn't change when you copy it forward, but the ID does. Technically, you should then create a Run in TFS. With test Items in it. You should then pass/fail the Items in the Run. When you complete the Run, the associated Suite should updates IT'S Items in line with the pass/fail's in the Run. But that's where the RESTful API is (or was last time I checked) broken. That link doesn't work. And Suites do not update in line with Runs as they should. So, instead, I update each test Item in the Suite directly as it completes. As a stopgap. It works fine. Just makes grouping for reporting a little less intuitive as you don't have everything gathered in a single run. It's basically the same as a manual tester right clicking on a test within a Suite setting it's pass/fail status. Hope this lot helps as understanding the data structures used, and how to use them in such a way that I don't have to updatehundreds of identifiers every time I want to do a run,was probably the trickiest bit of using the API to figure out! Re: Publish TC results to Visual Studio Online It can be done. But not natively by TC. You can use the TFS API. It works with on-site and online versions. https://www.visualstudio.com/en-us/docs/integrate/api/test/overview But you'll need to build your own code to do it. I have a set of script extensions I use for exactly this. All my TC tests that are linked connect to TFS using this and update a specific test case with pass/fail/notes etc. But I'll warn you in advance, the API is a bit confusing when it comes to test items, due to the way a test "case" can be a test "item" in multiple test "suites", which get moved into a "run" when performing the actual tests. There are still a few bugs in it (the RESTful API is relatively new) - one of which involves updating "results" from a "run". And how you structure it will depend how you use TFS. My script extensions may or may not work for you. They were written to hook into TFS based on how my company uses it, rather than being truly generic. (And I would also need company permission to upload them here. IP and all that ...) Re: database connection using testcomplete I'm in agreement with NisHeraand tristaanogre. (also that karthick7's answer has nothing to do with the question!) Also worth adding that if you're not sure about the connection string, speak to the development team rather than trying to guess. It's their database and they should understand, and so be able to tell you, it's connection requirements. Also, make sure you have the 32 bit drivers installed. See the note here: https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sources/databases/index.html