package attribue;
 
import java.net.MalformedURLException;
import java.net.URL;
 
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
 
public class ParallelAttributeTest {
 
 
   	public String username = "YOUR_USERNAME";
   	public String accesskey = "YOUR_ACCESS_KEY";
   	public static RemoteWebDriver driver = null;
   	public String gridURL = "@hub.lambdatest.com/wd/hub";
   	boolean status = false;
 
//Method to set up the browser and open the lambda test website
   	@BeforeClass
   	public void setUp() {
          	
          	//You need to set desired capabilities which you can generate from Capability Generator from Lambda Test as per your requirements
   	   	DesiredCapabilities capabilities = new DesiredCapabilities();
          	capabilities.setCapability("browserName", "chrome");
          	capabilities.setCapability("version", "81.0");
          	capabilities.setCapability("platform", "win10"); // If this cap isn't specified, it will get any available one
          	capabilities.setCapability("build", "LambdaTestProject");
          	capabilities.setCapability("name", "LambdaTestGetAttributeValueProject");
          	capabilities.setCapability("network", true); // Enables network logs
          	capabilities.setCapability("visual", true); // Enables step by step screenshot
          	capabilities.setCapability("video", true); // Enables video recording
          	capabilities.setCapability("console", true); // Captures console logs
          	try {
   		   driver = new RemoteWebDriver(new URL("https://" + username + ":" + accesskey + gridURL), capabilities);
          	} catch (MalformedURLException e) {
   		   System.out.println("Invalid grid URL");
          	} catch (Exception e) {
   		   System.out.println(e.getMessage());
          	}
   	}
   	
   	//Test method to get the attribute value
   	@Test
   	public void getAttrVals() {
          	
          	driver.get("https://www.lambdatest.com/");
   	   	driver.manage().window().maximize();
   	   	System.out.println("The attribute value is : " +driver.findElement(By.id("useremail")).getAttribute("placeholder"));
   	   	
   	}
   	
   	//Method to close the webdriver session
   	@AfterClass
   	public void burnDown() {
          	driver.quit();
   	}
}