public void TestChangeStatusReasonToRejected()
        {
            /**
             * var url = ObjectRepository.FromAppConfig.GetCrmUrl();
             * var password = ObjectRepository.FromEnviron.GetCrmPassword();
             * var username = ObjectRepository.FromEnviron.GetCrmUsername();
             *
             * //Login
             * NavigationHelper.LoginAndOpenDynamicsApp("Kentico CRM App", url, username, password);
             **/
            var url      = ObjectRepository.FromAppConfig.GetCrmUrl();
            var password = ObjectRepository.FromEnviron.GetPassword();
            var username = ObjectRepository.FromEnviron.GetUsername();

            NavigationHelper.LoginToDynamics("Kentico CRM App", url, username, password);

            //Create order
            OrdersPage ordersPage = new OrdersPage();

            ordersPage.Open();
            OrderPage order = ordersPage.CreateOrder();

            order.Fill("Name", "TestSeleniumCreateOrderWithProduct");
            order.Fill("Purchaser", "Test 2");
            order.Fill("Moved From", "Perpetual");
            order.Fill("Customer", "Test 2");
            order.Fill("Price List", "Kentico USD - 2020/07/01");
            order.Fill("Billing Office", "Kentico Software, LLC - USA Office");
            order.Fill("Delivery Contact", "jan");
            order.Save();
            //Add product to order
            var product = order.AddProduct();

            product.Fill("Existing Product", "Business - 1 Website Auto-Scalable License");
            ObjectRepository.XrmApp.ThinkTime(2000);
            product.Fill("Pricing", "false");
            product.Fill("Quantity", "1");
            order = product.SaveAndClose();
            order.SwitchStatusReason("Rejected");
            order.Save();
        }
        public void TestCreateOrder()
        {
            var url      = ObjectRepository.FromAppConfig.GetCrmUrl();
            var password = ObjectRepository.FromEnviron.GetCrmPassword();
            var username = ObjectRepository.FromEnviron.GetCrmUsername();

            //Login
            NavigationHelper.LoginAndOpenDynamicsApp("Kentico CRM App", url, username, password);
            //Create order
            OrdersPage ordersPage = new OrdersPage();

            ordersPage.Open();
            OrderPage order = ordersPage.CreateOrder();

            order.Fill("Name", "TestSeleniumCreateOrderWithProduct");
            order.Fill("Purchaser", "Test 2");
            order.Fill("Moved From", "Perpetual");
            order.Fill("Customer", "Test 2");
            order.Fill("Price List", "Kentico USD - 2020/07/01");
            order.Fill("Billing Office", "Kentico Software, LLC - USA Office");
            order.Fill("Delivery Contact", "jan");
            order.Save();
            //Add product to order
            var product = order.AddProduct();

            product.Fill("Existing Product", "Business - 1 Website Auto-Scalable License");
            ObjectRepository.XrmApp.ThinkTime(2000);
            product.Fill("Pricing", "false");
            product.Fill("Quantity", "1");
            order = product.SaveAndClose();
            var orderId = order.GetRecordId();

            //order.Fill("Name", "TestSeleniumCreateOrderWith");
            ordersPage = order.SaveAndClose();
            Assert.IsTrue(ordersPage.RecordExists(order, orderId), "Order hasn´t been created.");
        }