public void PlaceBuyOrderWithReserveOrderType(string instruments, string ordertype, string ordersize, string limitprice, string displayquantity)
        {
            try
            {
                IWebElement instrumet = driver.FindElement(instrument);
                UserSetFunctions.VerifyWebElement(instrumet);
                UserSetFunctions.SelectDropdown(instrumet, instruments);

                IWebElement ordertyp = driver.FindElement(orderType);
                UserSetFunctions.VerifyWebElement(ordertyp);
                UserSetFunctions.SelectDropdown(ordertyp, ordertype);

                IWebElement ordersiz = driver.FindElement(orderSize);
                UserSetFunctions.VerifyWebElement(ordersiz);
                UserSetFunctions.EnterText(ordersiz, ordersize);

                IWebElement limitpric = driver.FindElement(limitPrice);
                UserSetFunctions.VerifyWebElement(limitpric);
                UserSetFunctions.EnterText(limitpric, limitprice);

                IWebElement displayquntity = driver.FindElement(displayQuntity);
                UserSetFunctions.VerifyWebElement(displayquntity);
                UserSetFunctions.EnterText(displayquntity, displayquantity);


                IWebElement placebuyorder = driver.FindElement(placeByOrder);
                UserSetFunctions.VerifyWebElement(placebuyorder);
                UserSetFunctions.Click(placebuyorder);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
 public Dictionary <string, string> PlaceSellOrderWithReserveOrderType(string orderSize, string limitPrice, string displayQuantity)
 {
     try
     {
         string placeOrderTime;
         string placeOrderTimePlusOneMin;
         string successMsg;
         Dictionary <string, string> reserveSellOrderDict = new Dictionary <string, string>();
         UserSetFunctions.VerifyWebElement(OrderSizeEditBox(driver));
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.VerifyWebElement(LimitPriceEditBox(driver));
         UserSetFunctions.EnterText(LimitPriceEditBox(driver), limitPrice);
         UserSetFunctions.VerifyWebElement(DisplayQuntityEditBox(driver));
         UserSetFunctions.EnterText(DisplayQuntityEditBox(driver), displayQuantity);
         UserSetFunctions.VerifyWebElement(PlaceSellOrderButton(driver));
         UserSetFunctions.Click(PlaceSellOrderButton(driver));
         successMsg               = UserCommonFunctions.GetTextOfMessage(driver, logger);
         placeOrderTime           = GenericUtils.GetCurrentTime();
         placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
         Assert.Equal(Const.OrderSuccessMsg, successMsg);
         reserveSellOrderDict.Add("PlaceOrderTime", placeOrderTime);
         reserveSellOrderDict.Add("PlaceOrderTimePlusOneMin", placeOrderTimePlusOneMin);
         Thread.Sleep(2000);
         return(reserveSellOrderDict);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        // This method verifies the persistence of Amount entered in the Order Size field
        public bool VerifyOrderEntryAmountPersistence(string amountEntered)
        {
            bool   flag = false;
            string exchangeStringValueFromSite;

            UserCommonFunctions.DashBoardMenuButton(driver);
            UserCommonFunctions.SelectAnExchange(driver);
            Thread.Sleep(2000);
            exchangeStringValueFromSite = ExchangeMenuText().Text;
            Thread.Sleep(2000);

            if (exchangeStringValueFromSite.Equals(exchangeMenuString))
            {
                logger.Info("Verification for exchangeMenu value has been passed.");
                UserSetFunctions.Click(MarketOrderTypeButton());
                UserSetFunctions.EnterText(BuyAmountTextField(), amountEntered);
                UserSetFunctions.Click(LimitOrderTypeButton());
                UserSetFunctions.Click(StopOrderTypeButton());
                UserSetFunctions.Click(MarketOrderTypeButton());
                Thread.Sleep(2000);
                string amountPersisted = BuyAmountTextField().GetAttribute("value");
                if (amountEntered.Equals(amountPersisted))
                {
                    logger.Info("Test case has been passed for Buy Market Order Type.");
                    flag = true;
                }
                else
                {
                    logger.Info("Test case has been failed for Buy Market Order Type.");
                    flag = false;
                }

                UserSetFunctions.Click(SellOrderEntryButton());
                UserSetFunctions.EnterText(SellAmountTextField(), amountEntered);
                UserSetFunctions.Click(MarketOrderTypeButton());
                UserSetFunctions.Click(LimitOrderTypeButton());
                UserSetFunctions.Click(StopOrderTypeButton());

                Thread.Sleep(2000);
                if (amountEntered.Equals(amountPersisted))
                {
                    logger.Info("Test case has been passed for Sell Market Order Type.");
                    flag = true;
                }
                else
                {
                    logger.Info("Test case has been failed for Sell Market Order Type.");
                    flag = false;
                }
            }
            else
            {
                logger.Info("Verification for exchangeMenu value has been failed.");
                flag = false;
            }
            return(flag);
        }
Пример #4
0
        // This method verifies the persistence of Amount entered in the Order Size field
        public bool VerifyOrderEntryAmountPersistence(string instrument, string amountEntered)
        {
            bool   flag = false;
            string exchangeStringValueFromSite;

            UserCommonFunctions.DashBoardMenuButton(driver);
            UserCommonFunctions.SelectAnExchange(driver);
            Thread.Sleep(2000);
            exchangeStringValueFromSite = ExchangeMenuText().Text;
            if (exchangeStringValueFromSite.Equals(TestData.GetData("MenuTab")))
            {
                logger.LogCheckPoint(LogMessage.ExchangeMenuVerifiedSuccessfully);
                UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver);
                UserSetFunctions.Click(MarketOrderTypeButton());
                UserSetFunctions.EnterText(BuyAmountTextField(), amountEntered);
                UserSetFunctions.Click(LimitOrderTypeButton());
                UserSetFunctions.Click(StopOrderTypeButton());
                UserSetFunctions.Click(MarketOrderTypeButton());
                Thread.Sleep(2000);
                string amountPersisted = BuyAmountTextField().GetAttribute("value");
                if (amountEntered.Equals(amountPersisted))
                {
                    logger.LogCheckPoint(String.Format(LogMessage.AmountPersistenceCheckSuccessMsg, TestData.GetData("BuyTab")));
                    flag = true;
                }
                else
                {
                    logger.LogCheckPoint(String.Format(LogMessage.AmountPersistenceCheckFailureMsg, TestData.GetData("BuyTab")));
                    flag = false;
                }

                UserSetFunctions.Click(SellOrderEntryButton());
                UserSetFunctions.EnterText(SellAmountTextField(), amountEntered);
                UserSetFunctions.Click(MarketOrderTypeButton());
                UserSetFunctions.Click(LimitOrderTypeButton());
                UserSetFunctions.Click(StopOrderTypeButton());

                Thread.Sleep(2000);
                if (amountEntered.Equals(amountPersisted))
                {
                    logger.LogCheckPoint(String.Format(LogMessage.AmountPersistenceCheckSuccessMsg, TestData.GetData("SellTab")));
                    flag = true;
                }
                else
                {
                    logger.LogCheckPoint(String.Format(LogMessage.AmountPersistenceCheckFailureMsg, TestData.GetData("SellTab")));
                    flag = false;
                }
            }
            else
            {
                logger.LogCheckPoint(LogMessage.ExchangeMenuVerificationFailed);
                flag = false;
            }
            return(flag);
        }
        public void AdvanceBuyLimitOrderIOC(string orderType, string instrument, string orderSize, string limitPrice)
        {
            objAdvancedOrderPage = new AdvancedOrderPage(output);
            objUserFunctionality = new UserFunctionality(output);

            objAdvancedOrderPage.PlaceBuyOrderWithImmediateOrCancelType(orderType, instrument, orderSize, limitPrice);
            UserSetFunctions.EnterText(driver.FindElement(advanceOrderSizeAmount), orderSize);
            UserSetFunctions.EnterText(driver.FindElement(advanceOrderLimitAmount), limitPrice);
            UserSetFunctions.Click(driver.FindElement(placeBuyOrderButton));
        }
Пример #6
0
 // This method will enter accountId in textfield
 public void EnterAccountId(string accountId)
 {
     try
     {
         UserSetFunctions.EnterText(AccountIdTextField(), accountId);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #7
0
 // This method will enter userId in textfield
 public void EnterUserId(string userId)
 {
     try
     {
         UserSetFunctions.EnterText(UserIdTextField(), userId);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #8
0
 // This method will enter tradeId in textfield
 public void EnterTradeId(string tradeId)
 {
     try
     {
         UserSetFunctions.EnterText(TradeIdTextField(), tradeId);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #9
0
 // This method will enter executionId in textfield
 public void EnterExecutionId(string executionId)
 {
     try
     {
         UserSetFunctions.EnterText(ExecutionIdTextField(), executionId);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #10
0
 // This method enters the Sell Amount value
 public void EnterSellAmount(string amountEntered)
 {
     try
     {
         Thread.Sleep(2000);
         UserSetFunctions.EnterText(SellAmountTextField(), amountEntered);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public void SellAndVerifyMarketOrderFlow(string instrument, IWebDriver driver, string amountPrice)
        {
            bool flag = false;

            Thread.Sleep(3000);
            CommonFunctionality.SelectDashBoardButton(driver);
            Thread.Sleep(2000);


            string exchangeStringValueFromSite = driver.FindElement(exchangeMenuText).Text;

            Thread.Sleep(3000);

            if (exchangeStringValueFromSite.Equals(exchangeMenuString))
            {
                Assert.True(true, "Verification for exchangeMenu value has been passed.");
                output.WriteLine("Verification for exchangeMenu value has been passed.");
                flag = true;
            }
            else
            {
                Assert.False(false, "Verification for exchangeMenu value has been failed.");
                output.WriteLine("Verification for exchangeMenu value has been failed.");
                flag = false;
            }

            CommonFunctionality.SelectInstrumentFromExchange(instrument, driver);
            UserSetFunctions.Click(driver.FindElement(sellOrderEntryButton));
            UserSetFunctions.Click(driver.FindElement(marketOrderTypeButton));
            UserSetFunctions.EnterText(driver.FindElement(sellAmountTextField), amountPrice);

            Dictionary <string, string> balances = new Dictionary <string, string>();

            if (driver.FindElement(feesText).Enabled&& driver.FindElement(orderTotalText).Enabled&& driver.FindElement(netText).Enabled)
            {
                // Storing balances in Dictionary
                balances = CommonFunctionality.StoreMarketAmountBalances(driver);
                logger.Info("For Sell Order case --> Balances stored successfully.");
                output.WriteLine("For Sell Order case --> Balances stored successfully.");
            }
            else
            {
                logger.Error("For Sell Order case --> Fees or Order Total or Net amount is not present");
                output.WriteLine("For Sell Order case --> Fees or Order Total or Net amount is not present");
            }

            Thread.Sleep(2000);
            UserSetFunctions.Click(driver.FindElement(placeSellOrderButton));
            // This needs to be changed - crate locator class
            CommonFunctionality.FilledOrderTab(driver);
            CommonFunctionality.ScrollingDownVertical(driver);
        }
Пример #12
0
        public void Login(string userName, string password)
        {
            UserSetFunctions.SelectDropdown(driver.FindElement(selectServer), "wss://apiapexqa2.alphapoint.com/WSGateway/");
            UserSetFunctions.EnterText(driver.FindElement(loginName), userName);
            UserSetFunctions.EnterText(driver.FindElement(loginPassword), password);
            UserSetFunctions.Click(driver.FindElement(loginButton));

            output.WriteLine("Title--------------------" + driver.Title);
            Assert.Equal(driver.Title.ToLower(), "APEX Web".ToLower());

            //This returns new object of Home page such that it initializes the parameters of Home page after login
            //return new UserHomePage(driver);
        }
        public void VerifyAdvanceBuyOrder(string instrument, IWebDriver driver, string orderSize)
        {
            bool flag = false;

            Thread.Sleep(3000);
            CommonFunctionality.SelectDashBoardButton(driver);
            Thread.Sleep(2000);


            string exchangeStringValueFromSite = driver.FindElement(exchangeMenuText).Text;

            Thread.Sleep(3000);

            if (exchangeStringValueFromSite.Equals(exchangeMenuString))
            {
                Assert.True(true, "Verification for exchangeMenu value has been passed.");
                output.WriteLine("Verification for exchangeMenu value has been passed.");
                flag = true;
            }
            else
            {
                Assert.False(false, "Verification for exchangeMenu value has been failed.");
                output.WriteLine("Verification for exchangeMenu value has been failed.");
                flag = false;
            }

            CommonFunctionality.SelectInstrumentFromExchange(instrument, driver);
            UserSetFunctions.Click(driver.FindElement(advanceOrderButton));

            UserSetFunctions.SelectDropdown(driver.FindElement(instrumentList), instrumentValue);
            UserSetFunctions.SelectDropdown(driver.FindElement(orderTypeList), orderTypeValue);

            UserSetFunctions.EnterText(driver.FindElement(ordersizeTextField), orderSize);

            Thread.Sleep(3000);
            //Dictionary<string, string> balances = new Dictionary<string, string>();

            if (driver.FindElement(feesText).Displayed&& driver.FindElement(ordersizeTextField).Displayed)
            {
                // Storing balances in Dictionary
                //balances = CommonFunctionality.StoreMarketAmountBalances(driver);
                logger.Info("Fees and OrderTotal is displaying in the page.");
                output.WriteLine("Fees and OrderTotal is displaying in the page.");
            }
            else
            {
                logger.Error("Fees and OrderTotal is displaying in the page.");
                output.WriteLine("Fees and OrderTotal is displaying in the page.");
            }
            UserSetFunctions.Click(driver.FindElement(placeBuyOrderButton));
        }
Пример #14
0
 public void PlaceSellOrderWithImmediateOrCancelType(string orderSize, string limitPrice)
 {
     try
     {
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.EnterText(LimitPriceEditBox(driver), limitPrice);
         UserSetFunctions.Click(PlaceSellOrderButton(driver));
         Thread.Sleep(2000);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public void StopBuyOrder(string instrument, IWebDriver driver, string buyAmount, string stopPrice)
        {
            CommonFunctionality.SelectDashBoardButton(driver);

            Thread.Sleep(2000);

            CommonFunctionality.SelectInstrumentFromExchange(instrument, driver);

            //Verifying whether Buy Button and Stop Button is present or not.
            if (driver.FindElement(buyOrderEntryButton).Selected&& driver.FindElement(stopOrderTypeButton).Selected)
            {
                logger.Info("For Buy Stop Order case ---> Balances stored successfully.");
                output.WriteLine("For Buy Stop Order case ---> Balances stored successfully.");
            }
            else
            {
                logger.Info("For Buy Stop Order case ---> Balances stored successfully.");
                output.WriteLine("For Buy Stop Order case ---> Balances stored successfully.");
            }


            // Select Stop Buy Order
            UserSetFunctions.Click(driver.FindElement(stopOrderTypeButton));
            UserSetFunctions.EnterText(driver.FindElement(buyAmountTextField), buyAmount);
            UserSetFunctions.EnterText(driver.FindElement(stopPriceTextField), stopPrice);

            // Verify Market Price, Fees and Order Total
            Dictionary <string, string> balances = new Dictionary <string, string>();

            if (driver.FindElement(feesText).Enabled&& driver.FindElement(orderTotalText).Enabled&& driver.FindElement(marketPriceText).Enabled)
            {
                // Storing balances in Dictionary
                balances = CommonFunctionality.StoreMarketAmountBalances(driver);
                logger.Info("For Buy Stop Order case ---> Balances stored successfully.");
                output.WriteLine("For Buy Stop Order case ---> Balances stored successfully.");
            }
            else
            {
                logger.Error("For Buy stop Order case ---> Market or Order Total or Net amount is not present");
                output.WriteLine("For Buy stop Order case ---> Market or Order Total or Net amount is not present");
            }

            // Place Buy Order
            UserSetFunctions.Click(driver.FindElement(placeBuyOrderButton));

            // Verify Success message

            // Verify entry in Order Book
            // Verify entry Open orders tab
        }
        public void AdvanceSellLimitOrderIOC(string orderType, string instrument, string orderSize, string limitPrice, string selectTimeInForceOrderEntryValue)
        {
            UserSetFunctions.Click(driver.FindElement(sellButton));
            objAdvancedOrderPage = new AdvancedOrderPage(output);
            objUserFunctionality = new UserFunctionality(output);

            objAdvancedOrderPage.PlaceBuyOrderWithImmediateOrCancelType(orderType, instrument, orderSize, limitPrice);
            UserSetFunctions.EnterText(driver.FindElement(advanceOrderSizeAmount), orderSize);
            UserSetFunctions.EnterText(driver.FindElement(advanceOrderLimitAmount), limitPrice);
            UserSetFunctions.Click(driver.FindElement(placeSellOrderButton));
            objUserFunctionality.SelectTimeInForceOrderEntry(selectTimeInForceOrderEntryValue);

            Thread.Sleep(2000);
            UserSetFunctions.Click(driver.FindElement(openOrderTabButton));
        }
Пример #17
0
        public void PlaceMultipleLimitSellOrder(string instrument, string side, string sellAmount, string limitPrice, string timeinforce)
        {
            string successMsg;
            string placeOrderTime;
            string placeOrderTimePlusOneMin;

            Dictionary <string, string> limitSellOrderData = new Dictionary <string, string>();

            string askPrice = AskPrice(driver).Text;

            if (BuyOrderEntryButton().Displayed&& StopOrderTypeButton().Displayed)
            {
                UserSetFunctions.Click(OrderEntryButton());
                UserSetFunctions.Click(SellOrderEntryButton());
                UserSetFunctions.Click(MarketOrderTypeButton());
                Thread.Sleep(1000);
                UserSetFunctions.Click(LimitOrderTypeButton());
                UserSetFunctions.EnterText(SellAmountTextField(), sellAmount);
                UserSetFunctions.EnterText(LimitPriceTextBox(), limitPrice);
                UserSetFunctions.SelectDropdown(TimeInForce(), timeinforce);
                // Verify Market Price, Fees and Order Total
                Dictionary <string, string> balances = new Dictionary <string, string>();
                if (OrderTotalText().Enabled&& MarketPriceText().Enabled)
                {
                    // Storing balances in Dictionary
                    Thread.Sleep(1000);
                    balances = UserCommonFunctions.StoreOrderEntryAmountBalances(driver);
                    Assert.True(VerifySellLimitFees(balances[Const.Fees], sellAmount, limitPrice));
                    Assert.True(VerifyLimitOrderTotal(balances[Const.OrderTotal], sellAmount, limitPrice));
                    Assert.True(VerifySellOrderNet(balances[Const.Net], balances[Const.Fees], balances[Const.OrderTotal]));
                    logger.LogCheckPoint(string.Format(LogMessage.BalancesVerifiedSuccessfully, side, balances[Const.Fees], balances[Const.OrderTotal], balances[Const.Net]));
                }
                else
                {
                    logger.LogCheckPoint(string.Format(LogMessage.BalancesVerificationFailed, side));
                }
                UserSetFunctions.Click(PlaceSellOrderButton());
                UserCommonFunctions.ConfirmWindowOrder(askPrice, limitPrice, driver);
                successMsg               = UserCommonFunctions.GetTextOfMessage(driver, logger);
                placeOrderTime           = GenericUtils.GetCurrentTime();
                placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
                Assert.Equal(Const.OrderSuccessMsg, successMsg);
                logger.LogCheckPoint(String.Format(LogMessage.MarketOrderPlacedSuccessfully, side, sellAmount));
                Thread.Sleep(2000);
                UserCommonFunctions.ScrollingDownVertical(driver);
                logger.LogCheckPoint(String.Format(LogMessage.LimitOrderSuccessMsg, side, sellAmount, limitPrice));
            }
        }
        public void BuyAndVerifyMarketOrderFlow(string instrument, IWebDriver driver, string amountEntered)
        {
            Thread.Sleep(3000);

            // This needs to be changed - crate locator class
            CommonFunctionality.SelectDashBoardButton(driver);

            Thread.Sleep(2000);

            CommonFunctionality.SelectInstrumentFromExchange(instrument, driver);

            UserSetFunctions.Click(driver.FindElement(marketOrderTypeButton));
            UserSetFunctions.EnterText(driver.FindElement(buyAmountTextField), amountEntered);
            Thread.Sleep(2000);

            Dictionary <string, string> balances = new Dictionary <string, string>();


            if (driver.FindElement(feesText).Enabled&& driver.FindElement(orderTotalText).Enabled&& driver.FindElement(netText).Enabled)
            {
                // Storing balances in Dictionary
                balances = CommonFunctionality.StoreMarketAmountBalances(driver);
                logger.Info("For Buy Order case ---> Balances stored successfully.");
                output.WriteLine("For Buy Order case ---> Balances stored successfully.");
            }
            else
            {
                logger.Error("For Buy Order case ---> Fees or Order Total or Net amount is not present");
                output.WriteLine("For Buy Order case ---> Fees or Order Total or Net amount is not present");
            }

            // Place Buy Order
            UserSetFunctions.Click(driver.FindElement(placeBuyOrderButton));

            // Verify the balances stored
            foreach (KeyValuePair <string, string> amount in balances)
            {
                output.WriteLine("Key: {0}, Value: {1}", amount.Key, amount.Value);
            }

            Thread.Sleep(2000);
            // This needs to be changed - crate locator class
            CommonFunctionality.FilledOrderTab(driver);
            CommonFunctionality.ScrollingDownVertical(driver);
        }
 public Dictionary <string, string> PlaceMarketSellOrder(string orderSize)
 {
     try
     {
         Dictionary <string, string> placeSellOrderDict = new Dictionary <string, string>();
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.Click(PlaceSellOrderButton(driver));
         string placeOrderTime           = GenericUtils.GetCurrentTime();
         string placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
         placeSellOrderDict.Add("PlaceOrderTime", placeOrderTime);
         placeSellOrderDict.Add("PlaceOrderTimePlusOneMin", placeOrderTimePlusOneMin);
         Thread.Sleep(2000);
         return(placeSellOrderDict);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public string PlaceMarketBuyOrder(double buyAmount)
        {
            //UserFunctions objUserFunctionality = new UserFunctions(output);
            UserSetFunctions.Click(OrderEntryButton());
            UserSetFunctions.Click(BuyOrderEntryButton());
            UserSetFunctions.Click(MarketOrderTypeButton());
            UserSetFunctions.EnterText(BuyAmountTextField(), buyAmount.ToString());
            Thread.Sleep(2000);
            UserSetFunctions.Click(PlaceBuyOrderButton());
            Thread.Sleep(3000);

            // We will use below comments code once we get the proper order transaction message in the site.
            //string verifytransactionsMesg = UserCommonFunctions.GetTextOfSuccessfulMessage(driver, logger);
            //logger.Info("Current order transaction message ---> " + verifytransactionsMesg);

            UserCommonFunctions.ScrollingDownVertical(driver);
            Thread.Sleep(3000);
            return(GenericUtils.GetCurrentTime());
        }
Пример #21
0
 public void PlaceSellOrderWithReserveOrderType(string orderSize, string limitPrice, string displayQuantity)
 {
     try
     {
         UserSetFunctions.VerifyWebElement(OrderSizeEditBox(driver));
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.VerifyWebElement(LimitPriceEditBox(driver));
         UserSetFunctions.EnterText(LimitPriceEditBox(driver), limitPrice);
         UserSetFunctions.VerifyWebElement(DisplayQuntityEditBox(driver));
         UserSetFunctions.EnterText(DisplayQuntityEditBox(driver), displayQuantity);
         UserSetFunctions.VerifyWebElement(PlaceSellOrderButton(driver));
         UserSetFunctions.Click(PlaceSellOrderButton(driver));
         Thread.Sleep(2000);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public string PlaceStopSellOrder(double sellAmount, double stopPrice)
        {
            //UserFunctions objUserFunctionality = new UserFunctions(output);
            if (SellOrderEntryButton().Displayed&& StopOrderTypeButton().Displayed)
            {
                logger.Info("For Sell Stop Order case ---> Balances stored successfully.");
            }
            else
            {
                logger.Error("For Sell stop Order case ---> Market or Order Total or Net amount is not present");
            }
            UserSetFunctions.Click(OrderEntryButton());
            UserSetFunctions.Click(SellOrderEntryButton());
            UserSetFunctions.Click(StopOrderTypeButton());
            UserSetFunctions.EnterText(SellAmountTextField(), sellAmount.ToString());
            UserSetFunctions.EnterText(StopPriceTextField(), stopPrice.ToString());

            Thread.Sleep(3000);

            // Verify Market Price, Fees and Order Total
            Dictionary <string, string> balances = new Dictionary <string, string>();

            if (OrderTotalText().Enabled&& MarketPriceText().Enabled)
            {
                // Storing balances in Dictionary
                balances = UserCommonFunctions.StoreOrderEntryAmountBalances(driver);
                logger.Info("For Sell Stop Order case ---> Balances stored successfully.");
            }
            else
            {
                logger.Error("For Sell stop Order case ---> Market or Order Total or Net amount is not present");
            }
            Thread.Sleep(2000);
            UserSetFunctions.Click(PlaceSellOrderButton());
            Thread.Sleep(3000);
            string verifytransactionsMesg = UserCommonFunctions.GetTextOfSuccessfulMessage(driver, logger);

            logger.Info("Current order transaction message ---> " + verifytransactionsMesg);
            UserCommonFunctions.ScrollingDownVertical(driver);
            Thread.Sleep(3000);
            return(GenericUtils.GetCurrentTime());
        }
Пример #23
0
 public Dictionary <string, string> PlaceSellOrderWithImmediateOrCancelType(string orderSize, string limitPrice)
 {
     try
     {
         Dictionary <string, string> placeSellOrderDict = new Dictionary <string, string>();
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.EnterText(LimitPriceEditBox(driver), limitPrice);
         UserSetFunctions.Click(PlaceSellOrderButton(driver));
         string placeOrderTime           = GenericUtils.GetCurrentTime();
         string placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
         placeSellOrderDict.Add("PlaceOrderTime", placeOrderTime);
         placeSellOrderDict.Add("PlaceOrderTimePlusOneMin", placeOrderTimePlusOneMin);
         Thread.Sleep(2000);
         return(placeSellOrderDict);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public string PlaceMarketSellOrder(double sellAmount)
        {
            //UserFunctions objUserFunctionality = new UserFunctions(output);
            UserSetFunctions.Click(driver.FindElement(orderEntryButton));
            UserSetFunctions.Click(driver.FindElement(sellOrderEntryButton));
            UserSetFunctions.Click(driver.FindElement(marketOrderTypeButton));
            UserSetFunctions.EnterText(SellAmountTextField(), sellAmount.ToString());
            Thread.Sleep(2000);
            UserSetFunctions.Click(PlaceSellOrderButton());
            Thread.Sleep(3000);

            string verifytransactionsMesg = UserCommonFunctions.GetTextOfSuccessfulMessage(driver, logger);

            logger.Info("Current order transaction message ---> " + verifytransactionsMesg);

            UserCommonFunctions.ScrollingDownVertical(driver);
            Thread.Sleep(3000);

            return(GenericUtils.GetCurrentTime());
        }
Пример #25
0
        public void VerifyAdvanceSellOrder(string instrument, IWebDriver driver, string orderSize)
        {
            Thread.Sleep(2000);
            UserCommonFunctions.DashBoardMenuButton(driver);
            Thread.Sleep(2000);
            string exchangeStringValueFromSite = driver.FindElement(exchangeMenuText).Text;

            Thread.Sleep(3000);

            if (exchangeStringValueFromSite.Equals(exchangeMenuString))
            {
                Assert.True(true, "Verification for exchangeMenu value has been passed.");
            }
            else
            {
                Assert.False(false, "Verification for exchangeMenu value has been failed.");
            }

            UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver);
            UserSetFunctions.Click(driver.FindElement(advanceOrderButton));

            Thread.Sleep(2000);
            UserSetFunctions.Click(driver.FindElement(sellButton));

            UserSetFunctions.SelectDropdown(driver.FindElement(instrumentList), instrument);
            UserSetFunctions.SelectDropdown(driver.FindElement(orderTypeList), orderTypeValue);

            UserSetFunctions.EnterText(driver.FindElement(ordersizeTextField), orderSize);

            if (driver.FindElement(orderTotalText).Enabled)
            {
                logger.Info("Fees and OrderTotal is displaying in the page.");
            }
            else
            {
                logger.Error("Fees and OrderTotal is displaying in the page.");
            }

            Thread.Sleep(2000);
            UserSetFunctions.Click(driver.FindElement(placeSellOrderButton));
        }
 public Dictionary <string, string> PlaceTrailingStopMarketBuyOrder(IWebDriver driver, string orderSize, string trailingAmount, string pegPriceValue)
 {
     try
     {
         Dictionary <string, string> placeBuyOrderDict = new Dictionary <string, string>();
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.EnterText(TrailingAmountEditBox(driver), trailingAmount);
         SelectPegPrice(pegPriceValue);
         UserSetFunctions.Click(PlaceBuyOrderButton(driver));
         string placeOrderTime           = GenericUtils.GetCurrentTime();
         string placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
         placeBuyOrderDict.Add("PlaceOrderTime", placeOrderTime);
         placeBuyOrderDict.Add("PlaceOrderTimePlusOneMin", placeOrderTimePlusOneMin);
         Thread.Sleep(2000);
         return(placeBuyOrderDict);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public Dictionary <string, string> PlaceStopLimitSellOrder(string orderSize, string limitPrice, string stopPrice, string timeInForce)
 {
     try
     {
         Dictionary <string, string> placeSellOrderDict = new Dictionary <string, string>();
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.EnterText(LimitPriceEditBox(driver), orderSize);
         UserSetFunctions.EnterText(StopPriceEditBox(driver), stopPrice);
         UserSetFunctions.SelectDropdown(TimeInForce(driver), timeInForce);
         UserSetFunctions.Click(PlaceSellOrderButton(driver));
         string placeOrderTime           = GenericUtils.GetCurrentTime();
         string placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
         placeSellOrderDict.Add("PlaceOrderTime", placeOrderTime);
         placeSellOrderDict.Add("PlaceOrderTimePlusOneMin", placeOrderTimePlusOneMin);
         Thread.Sleep(2000);
         return(placeSellOrderDict);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Пример #28
0
 public Dictionary <string, string> PlaceTrailingStopLimitSellOrder(string orderSize, string trailingAmount, string limitOffset, string pegPriceValue, string timeInForce)
 {
     try
     {
         Dictionary <string, string> placeSellOrderDict = new Dictionary <string, string>();
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.EnterText(TrailingAmountEditBox(driver), trailingAmount);
         UserSetFunctions.EnterText(LimitOffset(driver), limitOffset);
         SelectPegPrice(pegPriceValue);
         SelectTimeInForce(timeInForce);
         UserSetFunctions.Click(PlaceSellOrderButton(driver));
         string placeOrderTime           = GenericUtils.GetCurrentTime();
         string placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
         placeSellOrderDict.Add("PlaceOrderTime", placeOrderTime);
         placeSellOrderDict.Add("PlaceOrderTimePlusOneMin", placeOrderTimePlusOneMin);
         Thread.Sleep(2000);
         return(placeSellOrderDict);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #29
0
        //This method will perform buy trade report(Will be use by TC_35)
        public void SubmitBlockTradeReportForUser(string counterPartyPrice, string producBoughtPrice, string productSoldPrice)
        {
            try
            {
                OrderEntryPage orderEntryPage = new OrderEntryPage(driver, logger);
                //ReportBlockTradeButton();
                UserSetFunctions.EnterText(CounterPartyTextField(), counterPartyPrice);
                UserSetFunctions.EnterText(ProductBoughtTextField(), producBoughtPrice);
                UserSetFunctions.EnterText(ProductSoldTextField(), productSoldPrice);
                Thread.Sleep(2000);
                SubmitReportButton();
                Thread.Sleep(2000);
                ConfirmSubmitReportButton();
                Thread.Sleep(2000);
                string expectedBuyTradeReportOrderMsg = BuyTradeReportOrderMsg().Text;
                string actualCancelMsg = UserCommonFunctions.GetTextOfMessage(driver, logger);

                string actualBuyTradeReportOrderMsg = string.Format(LogMessage.BuyTradeReportOrderMesgSuccess);
                string expectedCancelMsg            = string.Format(LogMessage.BuyTradeReportOrderMesgCanceled);
                try
                {
                    Assert.Equal(expectedBuyTradeReportOrderMsg, actualBuyTradeReportOrderMsg);
                    logger.LogCheckPoint(string.Format(LogMessage.BuyTradeReportOrderMesgSuccess));
                }
                catch (Exception)
                {
                    logger.LogCheckPoint(string.Format(LogMessage.BuyTradeReportOrderMesgCanceled));
                }
                Thread.Sleep(2000);
                UserSetFunctions.Click(CloseReportBlockTradeWindowSection());
            }
            catch (Exception e)
            {
                throw e;
            }
        }
        public void PlaceBuyOrderWithImmediateOrCancelType(string instruments, string ordertype, string ordersize, string limitprice)
        {
            try
            {
                IWebElement instrumet = driver.FindElement(instrument);
                UserSetFunctions.SelectDropdown(instrumet, instruments);

                IWebElement ordertyp = driver.FindElement(orderType);
                UserSetFunctions.SelectDropdown(ordertyp, ordertype);

                IWebElement ordersiz = driver.FindElement(orderSize);
                UserSetFunctions.EnterText(ordersiz, ordersize);

                IWebElement limitpric = driver.FindElement(limitPrice);
                UserSetFunctions.EnterText(limitpric, limitprice);

                IWebElement placebuyorder = driver.FindElement(placeByOrder);
                UserSetFunctions.Click(placebuyorder);
            }
            catch (Exception e)
            {
                throw e;
            }
        }