two_apps.t

The following sample script file for the Classic Agent shows how you can locally test multiple applications. To use the sample with the Open Agent, you have to change the sample code, for example you have to replace all tags with locators.
testcase Test1 () appstate DefaultBaseState
  //SetActive each time you switch apps
  TestApplication.SetActive()
  TestApplication.File.New.Pick ()
  MDIChildWindow1.TextField1.SetPosition (1, 1)
  MDIChildWindow1.TextField1.TypeKeys ("In Test Application MDI Child Window #1.")
  //SetActive each time you switch apps
  TextEditor.SetActive ()
  TextEditor.File.New.Pick ()
  TextEditor.ChildWin("(untitled)[1]").TextField("#1")
    .TypeKeys ("In Text Editor untitled Document window.<Enter>")
  //SetActive each time you switch apps
  TestApplication.SetActive()
  LIST OF STRING lsTempStrings 
  lsTempStrings = MDIChildWindow1.TextField1.GetMultiText()
  Clipboard.SetText([LIST OF STRING]lsTempStrings)
  //SetActive each time you switch apps
  TextEditor.SetActive()
  TextEditor.ChildWin("(untitled)[1]").TextField("#1").SetMultiText(Clipboard.GetText(),2)
  TextEditor.VerifyCaption("FooBar")

testcase Test2 () appstate DefaultBaseState
  wMainWindow = TestApplication
  TestApplication.SetActive()
  TestApplication.File.New.Pick ()
  MDIChildWindow1.TextField1.SetPosition (1, 1)
  MDIChildWindow1.TextField1.TypeKeys ("In Test Application MDI Child Window #1.")
  wMainWindow = TextEditor
  TextEditor.SetActive ()
  TextEditor.File.New.Pick ()
  TextEditor.ChildWin("(untitled)[1]").TextField("#1")
    .TypeKeys ("In Text Editor untitled Document window.<Enter>")
  wMainWindow = TestApplication
  TestApplication.SetActive()
  LIST OF STRING lsTempStrings 
  lsTempStrings = MDIChildWindow1.TextField1.GetMultiText()
  Clipboard.SetText([LIST OF STRING]lsTempStrings)
  wMainWindow = TextEditor
  TextEditor.SetActive()
  TextEditor.ChildWin("(untitled)[1]").TextField("#1").SetMultiText(Clipboard.GetText(),2)