Page 1 of 1

Difference Execution Options

Posted: Fri Sep 13, 2013 2:40 pm
by jrob3rts
Hi,
I am testing a site against:
1. Several Browsers
2. Several client settings
Most of the functions are the same (say 95-98%), so I would like to reuse code where possible.

If there any way in which I can execute a test for Client A, against Browser 1, and have the scripts execute and flags or whatever be set that allow the right scripts, or parts of scripts to be run?

Challenges.....
FireFox, IE10 and Chrome have difference save as dialogues.
Client A will have a different title to Client B

James

Re: Difference Execution Options

Posted: Fri Sep 13, 2013 3:20 pm
by omayer
using regular expression might work--

public static void CloseThreeBrowser(string BrowserInfo, string txtMessgae)
{

if(BrowserInfo=="Chrome"){

Button bttn = "/form[@title~'.*Google Chrome']/container[@accessiblename='Google Chrome']//tabpage[@accessiblename~'[A-Za-z0-9_]']/button[@accessiblename='Close']";
bttn.Click();
Delay.Ms(2000);


}
else if(BrowserInfo=="Firefox"){


MenuItem menu = "/form[@title~'.*Mozilla Firefox']/toolbar[@accessiblename='Menu Bar']/?/?/menuitem[@accessiblename='File']";
menu.Click();
Delay.Ms(2000);


MenuItem menuExit="/form[@title~'.*Mozilla Firefox']/toolbar[@accessiblename='Menu Bar']/?/?/menuitem[@accessiblename='File']/?/?/menuitem[@accessiblename='Exit']";
menuExit.Click();
Delay.Ms(2000);


}

Report.Success(BrowserInfo + txtMessgae);


}

Re: Difference Execution Options

Posted: Mon Sep 16, 2013 4:16 pm
by Support Team
Hi,

Thanks for your input omayer!

There are different ways how such situations can be handled.
One would be using repository variables in combination with the data driven approach as described on the following blog: Cross-Browser Test Automation with Ranorex.

Regards,
Markus