public void Batchmoshop(IWebDriver driver, Datarow datarow, string items, string vers)
        {
            var screenshot = new Screenshot();
            try
            {
                var moshop = new MoShopConsole();
                moshop.Homepagetabs(driver, datarow);
                driver.Manage().Window.Maximize();

                var strArray = items.Split(new[] {','});

                foreach (var str in strArray.Where(str => str.Length != 0))
                {
                    #region Test Shop

                    if (str == "Create a Test Shop")
                    {
                        datarow.Newrow("", "", "Create a Test Shop", "", driver);
                        var testshop = new CreateShop();
                        testshop.Testshop(driver, datarow);

                        new LookandFeel().Lookandfeel(driver, datarow);

                        #region Global Settings

                        new GlobalSetting();
                        // global.globalsetting(driver);

                        #endregion
                    }

                    #endregion

                    #region Test Scrape

                    if (str == "Create a Test Scrape")
                    {
                        datarow.Newrow("", "", "Create a Test Scarpe", "", driver);
                        new Createscrape().CreateScrape(driver, datarow);
                    }

                    #endregion

                    #region Run Manual Scrape

                    if (str == "Run Manual Scrape")
                    {
                        datarow.Newrow("", "", "Run Manual Scrape", "", driver);
                        var run = new RunScrape();
                        run.Runscrape(driver, datarow);
                    }

                    #endregion

                    #region Custom Domain Name Feature and Localisation

                    if (str == "Validate Custom Domain Name Feature and Localisation")
                    {
                        datarow.Newrow("", "", "Validate Custom domain Name", "", driver);
                        new Shop().Culture(driver, datarow);
                    }

                    #endregion

                    #region "Run the Test Site - Scrape

                    if (str == "Run the Test Site - Scrape")
                    {
                        try
                        {
                            driver.Manage().Window.Size = new Size(400, 550);
                            datarow.Newrow("", "", "Run the Test Site", "", driver);
                            driver.Navigate().GoToUrl("http://testshop.mobankdev.com/");

                            new BlobStorage();
                            //blob.Blob(driver,datarow, "http://testshop.mobankdev.com/");
                            commtest(driver, datarow);
                        }
                        catch (Exception ex)
                        {
                            var e = ex.ToString();
                            datarow.Newrow("Exception", "Exception Not Expected", e, "FAIL", driver);
                        }
                    }

                    #endregion

                    #region Run the Test Site - DataFeed XML

                    if (str == "Run the Test Site - DataFeed XML")
                    {
                        var datafeed = new DatafeedXml();
                        datafeed.Datafeed(driver, datarow);
                        datarow.Newrow("", "", "Run the Test Site-DataFeed", "", driver);
                        driver.Navigate().GoToUrl("http://testshop.mobankdev.com/");

                        datarow.Newrow("", "", "Footer Links", "", driver);
                        var footer = new FooterTps();
                        footer.Footerhome(driver, "http://testshop.mobankdev.com/", datarow);
                        var relatedproduct = new RelatedProducts();
                        relatedproduct.Relatedproducts(driver, datarow);
                        //commtest(driver, datarow);
                    }

                    #endregion

                    #region Validate Products Against Live Site - Modropenia

                    if (str == "Validate Products Against Live Site - Modropenia")
                    {
                        var modrophenia = new Modrophenialive();
                        modrophenia.modrophenialiveproducts(driver);
                        var products = new Modropheniaproducts();
                        products.Product(datarow, driver);
                    }

                    #endregion

                    # region Delete Shop And Scrape

                    if (str != "Delete TestShop And TestScrape") continue;
                    var delete = new DeleteTestShop();
                    delete.Deleteshop(driver);
                    delete.Deletedscrape(driver);
        }

        #endregion Methods
    }

    catch(Exception exception)
    {
        var str2 = exception.ToString();
                datarow.Newrow("Exception", "Exception Not Expected", str2, "FAIL", driver);
                screenshot.Screenshotfailed(driver);
    }

     finally
    {
        datarow.Excelsave("MoshopConsole", driver, "*****@*****.**");
                screenshot.Screenshotfailed(driver);
                driver.Quit();
    }
}
        public void Batchtesting(string items, string url, IWebDriver driver, Datarow datarow)
        {
            try
            {
                new BlobStorage();
                // blob.Blob(driver,datarow, url);

                //string[] vesion = verson.Split(',');

                //foreach (string vsion in vesion)
                //{
                //    public const string version = vsion;
                //}

                var selectedvalue = items.Split(',');
                var i = 0;
                foreach (var function in selectedvalue)
                {
                    if (function == "Search")
                    {
                        datarow.Newrow("", "", "Search", "", driver);
                        new Searchsort().Search(driver);
                    }
                    if (function == "Test All Links in Mosite")
                    {
                        datarow.Newrow("", "", "All Links in Mosite - Validations", "", driver);
                        var hom = new LinksTps();
                        hom.Links(datarow, driver, url);
                        i++;
                    }
                    if (function == "Test Footer Links")
                    {
                        datarow.Newrow("", "", "Footer Links", "", driver);
                        var footer = new FooterTps();
                        footer.Footerhome(driver, url, datarow);
                        i++;
                    }
                    if (function == "Test Basket Functionality")
                    {
                        datarow.Newrow("", "", "Basket Functionality", "", driver);
                        var basket = new BasketsTps();
                        basket.Basket(driver, datarow, url);
                        i++;
                    }
                    if (function == "Test Product page - Test Add Product to Basket")
                    {
                        datarow.Newrow("", "", "User Journey", "", driver);
                        var userjour = new UserJourneyTps();
                        userjour.UserJourn(datarow, driver, url);
                        i++;
                    }
                    if (function == "Test Delete From Basket - Test product Unavailable")
                    {
                        datarow.Newrow("", "", "Delete From Basket", "", driver);
                        var delete = new Deletebasketstart();
                        delete.Deletebasstart(driver, datarow);
                        i++;
                    }

                    if (function == "Custom Checkout")
                    {
                        var ckout = new BatchCheckout();
                        ckout.Checkout(driver, url, datarow);
                    }

                    if (function == "Test Registration/Login - CheckOut Pages")
                    {
                        datarow.Newrow("", "", "Registration/Login", "", driver);
                        var login = new LoginRegistration();
                        login.Registration(driver, datarow);
                        i++;
                    }

                    if (function != "Test Mopay") continue;
                    try
                    {
                        datarow.Newrow("", "", "Mopay", "", driver);
                        var pay = new BatchPay();
                        pay.Batchpay(driver, url, datarow);
                    }
                    catch (Exception)
                    {
                        datarow.Newrow("Exception", "", "Exception Not Expected", "FAIL", driver);
                        _screenshot.Screenshotfailed(driver);
                    }

                    i++;
                }
            }
            catch (Exception)
            {
                datarow.Newrow("Exception", "", "Exception Not Expected", "FAIL", driver);
                _screenshot.Screenshotfailed(driver);
            }

            finally
            {
                datarow.Excelsave("Mosite", driver, "*****@*****.**");
                _screenshot.Screenshotfailed(driver);
                driver.Quit();
            }
        }
        public void Basket(IWebDriver driver, Datarow datarow, string url)
        {
            try
            {
                var title = driver.PageSource;

                var basketempty = title.Contains("user-scalable=yes") ? BasketV2.basketempty : BasketV1.Basketempty;
                try
                {
                    driver.FindElement(By.Id("BasketInfo")).Click();

                    datarow.Newrow("Basket Info Button", "Basket Info Button Is Expected",
                                   "Basket Info Button is Present", "PASS", driver);
                }
                catch (Exception ex)
                {
                    var e = ex.ToString();
                    datarow.Newrow("Basket Info Button", "Basket Info Button Is Expected", e, "FAIL", driver);
                    _screenshot.Screenshotfailed(driver);
                }

                try
                {
                    if (!title.Contains("user-scalable=yes"))
                    {
                        var value = driver.FindElement(By.Id("BasketInfo")).Text;
                        if (value == "(0)")
                        {
                            datarow.Newrow("Basket Value", "(0)", value, "PASS", driver);
                        }
                        else
                        {
                            datarow.Newrow("Basket Value", "(0)", value, "FAIL", driver);
                            _screenshot.Screenshotfailed(driver);
                        }
                    }

                    var basket = driver.FindElement(By.Id(basketempty)).Text;
                    if (basket == "Your basket is empty")
                    {
                        datarow.Newrow("Basket Page Text", "Your basket is empty", basket, "PASS", driver);
                    }
                    else
                    {
                        datarow.Newrow("Basket Page Text", "Your basket is empty", basket, "FAIL", driver);
                        _screenshot.Screenshotfailed(driver);
                    }
                }
                catch (Exception ex)
                {
                    var e = ex.ToString();
                    datarow.Newrow("Basket Info Text", "Basket Info Text Is Expected", e, "FAIL", driver);
                    _screenshot.Screenshotfailed(driver);
                }
                var basketurl = driver.Url;
                var footer = new FooterTps();
                footer.Footer(driver, datarow, basketurl);
            }
            catch (Exception ex)
            {
                var e = ex.ToString();
                datarow.Newrow("Exception", "Excepetion Not Expected", e, "FAIL", driver);
                _screenshot.Screenshotfailed(driver);
            }
        }