AutomationUsingSeleniumTest.SeleniumTest.TestCurrencyConvertorWithoutDDT C# (CSharp) Method

TestCurrencyConvertorWithoutDDT() private method

private TestCurrencyConvertorWithoutDDT ( ) : void
return void
        public void TestCurrencyConvertorWithoutDDT()
        {
            //Read your first country currency name
            var convertVal = "American Dollar";
            //Read your second contry currency
            var inToVal = "Indian Rupee";
            //Read Expected value from data source
            var expectedValue = "49.1446 INR";
            //Goto the Target website
            WebDriver.Navigate().GoToUrl("http://www.x-rates.com/calculator.html");
            WebDriverWait wait = new WebDriverWait(WebDriver, new TimeSpan(0, 0, 50));
            var setValueConvert = WebDriver.FindElement(By.Name("from"));
            var setValueInto = WebDriver.FindElement(By.Name("to"));
            var calculateButton = WebDriver.FindElement(By.Name("Calculate"));
            var outPutvalue = WebDriver.FindElement(By.Name("outV"));

            var selectConvertItem = new SelectElement(setValueConvert);
            var selectIntoItem = new SelectElement(setValueInto);

            selectConvertItem.SelectByText(convertVal);
            selectIntoItem.SelectByText(inToVal);
            calculateButton.Click();
            var currencyValue = outPutvalue.GetAttribute("value");

            Thread.Sleep(900);//Not a good practise to use Sleep
            //Get the screen shot of the web page and save it on local disk
            SaveScreenShot(WebDriver.Title);
            Assert.AreEqual(expectedValue, currencyValue.Trim());
        }