after the update I can't open a .bat file via user code.
If I try the same code in a new solution it works.
After my test stopped the report doesn't open, even though "Open report after execution" is enabled.
I updated from 6.0 to 6.1
This is my code.
Code: Select all
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using Ranorex;
using Ranorex.Core;
using Ranorex.Core.Testing;
using WinForms = System.Windows.Forms;
namespace EVOtools.Start
{
public partial class Oeffne_db_leer
{
/// <summary>
/// This method gets called right after the recording has been started.
/// It can be used to execute recording specific initialization code.
/// </summary>
private static string REL_PATH_TO_DB_BAT = @"..\..\..\Environment\Server";
private void Init()
{
// Your recording specific initialization code goes here.
}
public void openDB()
{
ProcessStartInfo psi = new
System.Diagnostics.ProcessStartInfo("start_clean_evotools_db.bat");
psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized;
psi.WorkingDirectory = Environment.CurrentDirectory + @"\" + REL_PATH_TO_DB_BAT;
Process.Start(psi);
}
}
}
Edit: With a absolute path I can open a .bat file, relative paths doesn't work.
But .exe files still work with relative paths.
Reports open, when i only run a recording, but don't when i start from "Test-Suite view".