ContributionsMost RecentMost LikesSolutionsRe: Calling 3rd party packages from scripts written in Python Did you copy your entire site-packages folder or just the win32com folder? You don't want the whole site-packages folder, only the folder of the third party package should go in the Lib folder, i.e. only copy the win32com folder into Lib, not entire site-packages. Re: How do I navigate between browser tabs using TestComplete All objects have properties, the Page object has a Visible property which is a boolean value. If the Page object corresponds to a tab that isn't currently selected the Visible property will be False. So if you want to find the tab that isn't selected you would look for the one that has Visible set to False. You can view the properties of an object when you highlight it in the Object Browser. Take a look at the ObjectGroupIndex, if you have two Page objects that can't be differentiated in any meaningful way this value will differ between the two Pages. Re: How do I navigate between browser tabs using TestComplete osaid_ahmad Really? What action are you trying to perform where it's not working? Say you have a browser open with a tab on google.com and another on yahoo.com with the yahoo.com tab being selected/focused. If you run the following script statement it should perform an action on the google tab without the need to do anything specific to gain control of that tab (specifically it puts text into the search textbox). Aliases.browser.Page("https://www.google.com/").Panel("viewport").Panel("searchform").Form("tsf").Panel(0).Panel(0).Panel("sbtc").Panel(0).Panel("sfdiv").Panel(0).Panel("sb_ifc0").Panel("gs_lc0").Textbox("lst_ib").SetText('Search for something') Re: How do I navigate between browser tabs using TestComplete Do you have the Page Objects NameMapped or do you know the URLs of the two separate tabs? If so you can just reference each Page object separately and TestComplete will pick the correct tab to perform actions on. Course that won't work if you have two tabs with the same web page open. If that's the case you can differentiate the two tabs by looking at the ObjectGroupIndex and Visible properties of the Page objects. Re: ADO recordset is closed when being returned from a function Ah, that's too bad. Guess things can't be easy all the time. Thanks for the suggestions, I'll try to do it with a Class as well. ADO recordset is closed when being returned from a function At times I need to check if a record has been inserted into an SQL database. Sometimes I need to wait for the record to be inserted into the database (we sync certain records between two databases, it syncs every 5 minutes). To do that I wrote the following function: def wait_record_in_db(conn_str, query_str, timeout=300): conn = open_db_conn(conn_str) #This function is definitely working. results = conn.execute_(query_str) while results.EOF and timeout > 0: Delay(20000) results = conn.execute_(query_str) timeout -= 20 return results Basically it just checks if the query returns any records, and if not waits until it does or the time limit has been reached. This way I can check if the record is in the database every 20 seconds and then return the results, instead of just hard-coding a 5 minute wait. The problem is that the recordset that this function returns is closed for some reason. When I try to check if the returned recordset has any records in it like this: results = wait_record_in_db(conn_str, query_str) if results.EOF: Log.Error('No record found') else: Log.Checkpoint('Record found') I get the following runtime error: RuntimeError ADODB.Recordset Operation is not allowed when the object is closed. This is the first time I've tried returning a recordset from a function. I have no idea why it would be closing the recordset in that context. If I take the code out of the function and just run it all from my main function it works fine. But obviously I don't want to have to repeat this same code everywhere I need to use it, that's the whole point of having functions in the first place :) Anyone have any ideas? I can't reopen the returned recordset, just gives me a different runtime error. The underlying connection isn't being closed in my script (I close it at the end of the test run). SolvedRe: I have a working python script, but it does not work in TestComplete When the script is working outside of TestComplete are you running it in a python 2.x instance? As you might already know TestComplete uses python 3.x, and from looking at the subprocess docs it seems a couple things changed between the versions. Probably isn't what's causing the issue, but figured I'd mention it. I wouldn't know what else would cause the issue, I haven't used the subprocess module in TestComplete before. All the other standard python modules have worked without a problem for me. Re: aqFile.Open (Just open it, Please) Nice, didn't think about opening the file through the shell. That should work exactly as BMD is expecting aqFile.open to work. Re: aqFile.Open (Just open it, Please) TC can open a file from drive, you're just not understanding what it means to open a file. Using aqFile.Open will open a direct filestream. If you know what you are doing you can try to parse your data out of a raw pdf stream. Also opening a pdf in a browser isn't going to open the adobe application. Browsers can natively read pdfs, typically using pdf.js. So when you open a pdf in a browser expect it to appear as just another Page object, adobe is not going to be opened. If you want to open a file in an application, you're going to have to launch that application first and open the file through the application. TestComplete isn't going to know the how and what of opening every file type that exists. I suppose they could have a built-in function that opens a file in the default program, the same as if you double click the file in Windows explorer. But that function doesn't exist right now from what I know. You could put in a feature request if you think it would be useful. Sounds useful, but it's not too hard to just setup a TestedApp to launch the application you want and then open the file within that application. Re: Compile tests to .Exe Perhaps an alternative would be a feature where the test captures a video of it's execution which could then be given to developers? Wouldn't be as good as the suggested feature, but the suggested feature is really asking a lot of SmartBear. The effort it would take to implement something like this seems monumental.