| || |
I am new to TestComplete.Currently I am working on a web based application.In that after creating a workflow and run the same script it gives error message that this workflow already exist.How should I write script for this.
Here is the script which i recorded.
Set p = Sys.Process("javaw")
Set w = p.Window("SWT_Window0", "BridgeGate Client [Account: daffodildb] User: [daffodildb]")
Call w.Window("ToolbarWindow32", "", 3).Click(0)
w.Window("Button", "", 1).Click
Call w.PopupMenu.Click("New Workflow Group...")
Set w = p.Window("SWT_Window0", "BridgeGate Client")
For "SimpleTestCase" It gives error message that this workflow already exist.
Thanx in Advance
I guess the 'workflow' you are talking about is something that is within your application. As far as I understand, the problem is that your application does not allow creating two 'workflows' with the same name. If my assumption is correct, I recommend that you just remove the existing 'workflow' before adding a new one to your script.
Your assumption is absulately correct.One thing I want that when I create the existing workflow then it will display message for already existing workflow,Through TC i want to compare this message,if match then exit otherwise it continues the test case.
Will you send me code for that.
Waiting for your kind response
If you need to check whether an error message exists, you can use the WaitWindow method to get this window and then check its Exists property. The WaitWindow method does not generate an error if the requested object does not exist. For more information, please see the 'Waiting for a Process or Window Activation' help topic.
If you want to check the text of the message, you need to find the object that stores this text. Look at the message window and its child objects in the Object Browser panel to figure out which object contains the text in one of its properties (most probably, in the 'WndCaption' property).
If you cannot find an object that stores the text, then, perhaps, the text is stored in one of native fields of these objects. TestComplete 2 cannot access native fields and methods of SWT applications' objects, so you will not be able to get the text. I recommend that you switch to TestComplete 5 as this version of the tool has a lot of new features, including the Java Open Applications support, as compared to version 2. You will be able to access all native properties and methods of objects in your SWT application from TestComplete scripts. You can download a free demo version of TestComplete 5 here:
BTW, if the message box you want to work with copies its contents to the clipboard when the Ctrl-C shortcut is pressed, you can simulate pressing this shortcut to get the text of the message via the clipboard. To access the clipboard in TestComplete scripts, you can use the 'Sys.Clipboard' property.