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
Difference Execution Options
Re: Difference Execution Options
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);
}
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);
}
Tipu
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Difference Execution Options
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
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