public WebElement getElementByAttribute(String Attribute,
				String AttributeType) {
			try {
				if (AttributeType.equalsIgnoreCase("css")) {
					testObjects = driver.findElements(By.cssSelector(Attribute));
				} else if (AttributeType.equalsIgnoreCase("id")) {
					testObjects = driver.findElements(By.id(Attribute));
				} else if (AttributeType.equalsIgnoreCase("name")) {
					testObjects = driver.findElements(By.name(Attribute));
				} else if (AttributeType.equalsIgnoreCase("xpath")) {
					testObjects = driver.findElements(By.xpath(Attribute));
				} else if (AttributeType.equalsIgnoreCase("class")) {
					testObjects = driver.findElements(By.className(Attribute));
				} else if (AttributeType.equalsIgnoreCase("text")) {
					testObjects = driver.findElements(By.linkText(Attribute));
				} else {
					throw new Exception("Incorrect Attribute type mentioned");
				}

				if (testObjects.size() == 0) {
					throw new NoSuchElementException("Element couldn't be located");
				} else {
					testObject = testObjects.get(0);
					// TODO add code for parsing between different objects returned.
				}
				return testObject;

			} catch (NoSuchElementException e) {
				return null;
			}

			catch (Exception e) {
				// TODO: handle exception
				return null;
			}
		}