Пример #1
0
        //public Suite NewSuite() {
        //    return DBManager.NewSuite();
        //}

        //private DBManager DBManager;

        //private DBManager _DBManager
        //{
        //    get
        //    {
        //        if (DBManager == null)
        //        {
        //            DBManager = new DBManager();
        //        }

        //        return DBManager;
        //    }

        //}

        //public  object List(EnumEntidade etd){
        //   var result =  _DBManager.List(etd);
        //   return result;
        //}

        //public List<Suite> ListSuites()
        //{
        //    var lt = (List<Suite>)List(EnumEntidade.Suite);
        //    return lt;
        //}

        public List <Elemento> Scrapp(Suite suite)
        {
            WebDriverInstance wbInstance = new WebDriverInstance();
            string            Xpath      = GetXpath();

            RunSuite(suite, wbInstance);
            var ruleList = GetXpathByLastCaso(suite);

            SetScrenShotTela(suite, wbInstance);
            if (ruleList.Count() == 0)
            {
                ruleList.Add(new Rule {
                    Nome = "GENERICO", XPath = Xpath
                });
            }

            List <Elemento> list = Scrapp(wbInstance, ruleList);

#if DEBUG
            foreach (var item in list)
            {
                log.TraceInicioFim();
                log.TraceWriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name, Sigef.Poc.Ftcapp.Util.CONST.ConstTraceException.METODO);
                log.TraceWriteLine(suite.Nome, Sigef.Poc.Ftcapp.Util.CONST.ConstTraceField.SUITE);
                log.TraceIdentAndUniIdent(item.Nome, Sigef.Poc.Ftcapp.Util.CONST.ConstTraceField.ELEMENTO);
                log.TraceInicioFim();
            }
            #endif
            wbInstance.DisposeInstance();

            return(list);
        }
Пример #2
0
        public Suite RunTeste(Suite suite)
        {
            WebDriverInstance wbInstance = new WebDriverInstance();

            RunSuite(suite, wbInstance);
            wbInstance.DisposeInstance();
            return(suite);
        }