Need Code for when my test fails
Need Code for when my test fails
need code for when my test fails with 1 browser tab open it opens another browser tab on when it fails because my teardown only works with 2 browser tabs open at the time of teardown.
Re: Need Code for when my test fails
It looks like your Repo itm which is identifying your browser window isn't the best one.If it's IE you might go with this rxpath:
/form[@windowtext<' - Internet Explorer']
if it's firefox then
/form[@processname='firefox']
or - if all fails you might use this bit of usercode which kills every process starting with the given string (case sensitive):
/form[@windowtext<' - Internet Explorer']
if it's firefox then
/form[@processname='firefox']
or - if all fails you might use this bit of usercode which kills every process starting with the given string (case sensitive):
Code: Select all
[UserCodeMethod]
public static void KillProcessStartingWith(string pProcessName){
String sExeName;
Process[] tmpProc;
Process[] processes = Process.GetProcesses();
if((processes!=null) && (processes.Length>0)){
for(int i=0; i<processes.Length; i++){
// Report.Info( processes[i].ProcessName );
if(processes[i].ProcessName.StartsWith(pProcessName)){
sExeName = processes[i].ProcessName;
tmpProc = Process.GetProcessesByName( sExeName );
for(int j=0; j<tmpProc.Length; j++){
tmpProc[j].Kill();
}
}
}
}
}
Vorsprung durch Wahnsinn
www.Doktor-Andy.de
www.Doktor-Andy.de