Example: Running a Test in Parallel

Use two separate Partner processes to run a test in parallel on Google Chrome and Mozilla Firefox.
  1. Create a new Silk Test Classic project. For example, name the new project Demo.
  2. Record a simple script in the browser of your choice against the Insurance Company sample web application. For example, record something like the following:
    [-] testcase TestQuote ()
      [-] recording
        [ ] WebBrowser.BrowserWindow.DemoApplication.Click()
        [ ] WebBrowser.BrowserWindow.LoginFormEmail.SetText("john.smith@gmail.com")
        [ ] WebBrowser.BrowserWindow.LoginFormPassword.SetText("john")
        [ ] WebBrowser.BrowserWindow.LoginFormLogin.Click()
        [ ] WebBrowser.BrowserWindow.QuickLinkJumpMenu.Select("Auto Quote")
        [ ] WebBrowser.BrowserWindow.QuickLinkJumpMenu.Select("Agent Lookup")
        [ ] WebBrowser.BrowserWindow.Home.Click()
        [ ] WebBrowser.BrowserWindow.LogoutFormLogout.Click()
        [ ] WebBrowser.BrowserWindow.Navigate("demo.borland.com")
  3. Save the recorded script, for example in a file named tests.t.
  4. For each browser that you want to run the test on perform the following:
    1. In the menu, select Options > Save New Options Set to create a new option set.
    2. Type a name for the file, for example Chrome.opt or Firefox.opt.
    3. Click Save.
    4. In the new file, replace the values for the TrueLog file path, the results path, and the browser type. For example, use the following values for Google Chrome:
      OPT_TRUELOG_FILEPATH=Chrome.tlz
      ResultsPath=.\Chrome.res
      BrowserType=GoogleChrome
      And the following for Mozilla Firefox:
      OPT_TRUELOG_FILEPATH=Firefox.tlz
      ResultsPath=.\Firefox.res
      BrowserType=Firefox
  5. Start the test runs in parallel using the runtime.exe and specifying the different option sets. For example, use the following commands to run command-line window to run the test in parallel on Google Chrome and Mozilla Firefox:
    c:\Users\<user>\Documents\Silk Test Classic Projects\Demo> runtime.exe -opt Chrome.opt -q -r tests.t
    c:\Users\<user>\Documents\Silk Test Classic Projects\Demo> runtime.exe -opt Firefox.opt -q -r tests.t
  6. Collect the results. Locate the files Chrome.tlz, Chrome.res, Firefox.tlz, and Firefox.res respectively.