Contributions
Re: Proper Way to Copy String?
@Tanya: I tried using the 'Text' property (I think because it's a label, it uses 'Text' instead of 'wText'), but it still gave me the same problem. I found the problem(a few days after my first post). Just now have time to post back here just what I found, in case some one else runs into the same. The line: -------------- DM_dbPathFileName = Aliases.DataModelServer.HwndSource_MainWindow.MainWindow.DockPanel.Grid.mDMGroup.DockPanel.Grid.mMDMControlsPanel.WPFObject("StackPanel", "", 1).WPFObject("Border", "", 1).WPFObject("mDBFileLabel").get_Text(); ------------- Or the line: ---------- DM_dbPathFileName = Aliases.DataModelServer.HwndSource_MainWindow.MainWindow.DockPanel.Grid.mDMGroup.DockPanel.Grid.mMDMControlsPanel.WPFObject("StackPanel", "", 1).WPFObject("Border", "", 1).WPFObject("mDBFileLabel").Text; ---------- is where I'm getting the text from the field in the window that is open during the testing. But, this does not copy the text into the var DM_dbPathFileName. What it does is copy a reference to the text location. At the end of the testing, just before I tried to copy the data file created by the program under test, I close the program being tested. (Have to close the program to close the data file.) As a result of closing the program, the window where the text resides is closed. As a result of closing the window, the reference now points to nothing and results in an empty string. Every direct copy of the text field that I tried resulted in copying the reference, not the actual text. What I ended up doing was to extract the actual text by the following. (I made a function out of it in case I need to do it elsewhere.): ------------------------- function GetActualText( Reference ) { var ref = "'" + Reference + "'"; // Single quotes inside of double quotes. var refText = aqString.SubString( ref, 1, aqString.GetLength( ref ) - 2 ); return refText; } ----------------------- Does anyone know if there is there a better way to force the actual text out of a reference to the text?843Views2likes0CommentsProper Way to Copy String?
Hello and thank for any help anyone can give me. A couple of weeks back, I added code to my main test routines to save the data file generated by the program under test. It went like this: ----------------- DM_dbPathFileName = Aliases.DataModelServer.HwndSource_MainWindow.MainWindow.DockPanel.Grid.mDMGroup.DockPanel.Grid.mMDMControlsPanel.WPFObject("StackPanel", "", 1).WPFObject("Border", "", 1).WPFObject("mDBFileLabel").get_Text(); --------------- The value being copied was of the format (C:\Documents and Settings\username\My Documents\DataModel Projects\20130319-110144.dm') without the parenthisis. This worked fine except that at the end of the test run, when it came time to copy the data file to a new location, the variable 'DM_dbPathFileName' was blank. I finally figured out that what was actually stored in 'DM_dbPathFileName' was a reference to the text in the window and not the actual text. When the window went away, so did the text(path/filename) that I needed. I couldn't leave the window open because the window has to be closed to close the file. Can't copy the file till it is closed. I fixed it by creating a routine to force the copying of the actual text rather than a reference to the text. ---------------- function GetActualText( Reference ) { ref = "'" + Reference + "'"; return aqString.SubString( ref, 1, GetLength( ref ) - 2 ); } -------------- My question is: Is there a proper, or at least better, way to do this? Again, thanks for any help anyone can give. ThWatcher7.6KViews0likes4CommentsCan a script in a TestComplete Project run a different TestComplete project?
Hello, and thanks to any who can help me. I tried asking this in the novice area but got no response. So now I'll try here. Is it possible to run a TestComplete Project from a script in another TestComplete project? Or, possibly in an alternate scenario; I have a series of projects that export their logs to an archive directory; And: If I have a set of routines in the 'Test Items' of the project, when the project is run, in Testcomplete, and in the Exported log, I get a nicely formatted/nested log with the summary and charts on the first page. But if I run the same routines from a script that calls the routines each in order, I don't get the same nesting in the log output nor do I get the summary and charts. How can I get or produce that summary and charts to place on my own log pages, possibly with my own variation of formatting? Again, thanks for any help.22KViews0likes1CommentCan a script in a TestComplete Project run a different TestComplete project?
Hello, and thanks to any who can help me. Is it possible to run a TestComplete Project from a script in another TestComplete project? Or, possibly in an alternate scenario; I have a series of projects that export their logs to an archive directory, but; And: If I have a set of routines in the 'Test Items' of a project, when the project is run, I get a nicely formatted/nested log with the summary and charts on the first page. But if I run the same routines from a script that calls them each in order, I don't get the same nesting nor do I get the summary and charts on a 'first page'. How can I get or produce that summary and charts to place on my own page, possibly with my own variation of formatting? Again, thanks for any help.19KViews0likes2Comments- 566Views0likes0Comments
Re: How to control scroll bar movement
Hi. I don't know if this will be of any help to you in your situation, but I had a similar problem with a list box. My list box had many items that were not in view, but that I needed to click on in a 'click and drag' test. I found that using the following command had the side effect of moving the scroll bar and bringing the desired item into view. Of course, this assumes you know the names of items in your tree or that you can retrieve the names of items in your tree. // Click the desired item. This brings the item into view in the list box. TargetDialog.Window("SysListView32", SourceListName).ClickItem(ItemName); where: 'SourceListName' is the name of the list box. 'ItemName' is the name of the item to be clicked in the list box.2.1KViews0likes0CommentsForm appears behind other windows.
I have a form for the user to select the path to the application to be tested. It works fine. But now I'm trying to call the routine and form from QMetry. And that works fine, except that the form appears behind other windows. You have to move or minimize the other windows before you can get to the 'Form'. I've tried calling 'SetFocus()' before calling the 'Form.Execute()'. I've tried calling it in the 'OnShow' event for the form. Ex.: ---------------------------------- function frmGetDMMWDRunPath_OnShow(Sender) { dialog.SetFocus(); } ---------------------------------- But neither of those seemed to work. So I'm asking for help from anyone who knows more about it than me. Thanks in advance for any help you can give. Rick16KViews0likes2Comments