testing - How Selenium handles 3 necessary problems -


i want develop framework. when framework done, package , send users(for example jar package). not able change source code. change xml or csv file configuration. example source has before procedure, after procedure , 20 tests. im stuck 3 problems; 1- want execute 20 tests execute different browsers. im setting browser in before procedure. how can change browser in runtime. 2- want group test procedures. , can run example 5 procedures of them. how can group tests , how can set run , not. , have without touching source code. 3- want make detailed reporting system. log every step of script. (user login success, menu open success etc..)

which framework can these? testng? or what?

thanks help

  1. i dont see problem, can create brand new browser instance everytime before start test, there can choose if should ie, chrome or ff. can use parameters testclasses, checked in @beforetest , according browser opened.
  2. groups supported testng , junit, prefer testng because more flexible
  3. only selenium 1 had step-by-step logging, afaik selenium 2 not support of it. did create new class "testelement" provided selenium method logging. there created new assertthat logs fails , success

    public static <t> void assertit(string reason, t actual, matcher<?> matcher) {     description description = new stringdescription();     description.appendtext(reason).appendtext("expected: ")         .appenddescriptionof(matcher).appendtext(", actual: ")         .appendvalue(actual);     string desc = description.tostring();     if (!matcher.matches(actual))     {         testlog.log(desc, testlog.loglevel.fail);         throw new assertionerror(desc);     }     else     {         testlog.log(desc, testlog.loglevel.pass);     } } 

Comments