public String CreateOrder(Creditcard myCreditCard, User myUser, Product myProduct)
	{			
		
	  	driver.get(baseUrl);
				
		while((isElementPresent(By.id("userName"))))
		{
			driver.findElement(By.id("userName")).sendKeys(myUser.getUserName());
			driver.findElement(By.id("password")).sendKeys(myUser.getUserPassword());
			driver.findElement(By.cssSelector("input[type=\"submit\"]")).click();
		}
			
		driver.findElement(By.id("createOrder")).click();
		
		driver.findElement(By.id("memberId")).sendKeys(myUser.getMemberId());
		driver.findElement(By.cssSelector("input.mainbutton")).click();
		
		if (isElementPresent(By.id("member.errors")))
		{
			System.out.println("Failed: " + myUser.getUserName() + "Error Message: " + driver.findElement(By.id("member.errors")).getText());
			return ("Failed: " + myUser.getUserName() + "Error Message: " + driver.findElement(By.id("member.errors")).getText());
		}
		
		if (isElementPresent(By.name("_target0")))
		{
			driver.findElement(By.name("_target0")).click();
		}
		
		String[] products = myProduct.getSku();
		int i = 0;
		String temp;
		boolean loop;
		do{
			temp = "";
			loop = false;
			driver.findElement(By.id("prod")).clear();
			driver.findElement(By.id("prod")).sendKeys(products[i]);
			driver.findElement(By.id("qty")).clear();
			driver.findElement(By.id("qty")).sendKeys("1");
			driver.findElement(By.name("_target2")).click();
			
			if (isElementPresent(By.id("orderForm.errors")))
			{
				temp = trimSpace(driver.findElement(By.id("orderForm.errors")).getText());
				
				if (!temp.equalsIgnoreCase(trimSpace("Item " + products[i] + " is out of stock and has been removed from the order.")))
				{
					System.out.println("Failed: " + myUser.getUserName() + " Error Message: " + driver.findElement(By.id("orderForm.errors")).getText());
					return ("Failed: " + myUser.getUserName() + " Error Message: " + driver.findElement(By.id("orderForm.errors")).getText());
				}
				else 
					loop = true;
			}
			i++;
		} while(loop);
		
		driver.findElement(By.id("continue")).click();
		String amount = "";
		List<WebElement> element = driver.findElements(By.id("payAmt"));
		for (WebElement j : element)
		{
			if (!(j.getAttribute("value").equals("")))
			{
			    amount = j.getAttribute("value");
			    j.clear();
			    driver.findElement(By.id("payAmt")).clear();
				driver.findElement(By.id("payAmt")).sendKeys(amount);
			    
				break;
			}
		} 
		
		if (driver.findElement(By.id("payTypeCD")).isEnabled())
			driver.findElement(By.id("payTypeCD")).sendKeys(myUser.getCardType());
		if (driver.findElement(By.id("accNum")).isEnabled())
		{
			driver.findElement(By.id("accNum")).sendKeys(myCreditCard.getCardNum());
			driver.findElement(By.id("accNum")).clear();
			driver.findElement(By.id("accNum")).sendKeys(myCreditCard.getCardNum());
		}
		if (driver.findElement(By.id("month")).isEnabled())
			driver.findElement(By.id("month")).sendKeys(myCreditCard.getExpMonth());
		if (driver.findElement(By.id("year")).isEnabled())
			driver.findElement(By.id("year")).sendKeys(myCreditCard.getExpYear());
		if (driver.findElement(By.id("cardHolder")).isEnabled())
			driver.findElement(By.id("cardHolder")).sendKeys(myCreditCard.getCcName());
		if (driver.findElement(By.id("authNumber")).isEnabled())
			driver.findElement(By.id("authNumber")).sendKeys(myCreditCard.getCcSecurity());
		if (driver.findElement(By.id("cvv")).isEnabled())
			driver.findElement(By.id("cvv")).sendKeys(myCreditCard.getCvvNum());
		
		List<WebElement> button = driver.findElements(By.className("mainbutton"));
		for (WebElement b : button)
		{
			if (b.getAttribute("value").equalsIgnoreCase("Save Sales Order"))
			{
				b.click();
				break;
			}
		}
		
		if (isElementPresent(By.id("orderForm.errors")))
		{
			System.out.println("Failed: " + myUser.getUserName() + " Error Message: " + driver.findElement(By.id("orderForm.errors")).getText());
			return ("Failed: " + myUser.getUserName() + " Error Message: " + driver.findElement(By.id("orderForm.errors")).getText());
		}
		
		
		String ordernum = "";
		ordernum = driver.findElement(By.cssSelector("strong")).getText();
		
		driver.get("https://test.nuskin.com/dowicSAP/menu.htm");
		driver.findElement(By.xpath("//input[@value='Order  Management']")).click();
		driver.findElement(By.id("orderRefNumberRadio")).click();
		driver.findElement(By.id("orderRefNumber")).sendKeys(ordernum);
		driver.findElement(By.name("_target1")).click();
		
		String orderrefnum = driver.findElement(By.id("id")).getText();

		if (trimSpace(ordernum).equals(trimSpace(orderrefnum)))
		{
			System.out.println("Success: " + myUser.getUserName() + " Reference Number: " + trimSpace(ordernum) + " Order Amount: $" + amount);
			return ("Success: " + myUser.getUserName() + " Reference Number: " + trimSpace(ordernum) + " Order Amount: $" + amount);
		} 
		
		System.out.println("Failed: " + myUser.getUserName() + " Error Message: Order not found");
		return "Failed: " + myUser.getUserName() + " Error Message: Order not found"; 
	}