Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

Create Automation Script to implement getCssValue() and getAttribute() :- 

 package scs; 
import org.openqa.selenium.By; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.WebElement; 
 public class GetCssValueExample
 public static void main(String[] args) 
 System.setProperty("", "c://chromedriver.exe"); 
 WebDriver driver = new ChromeDriver(); 
 WebElement we = driver.findElement("txt1"));
 String s = we.getCssValue("width"); 
 String s1 = we.getAttribute("placeholder"); 
 String s2 = " x= "+we.getLocation().getX() + " y= "+ we.getLocation().getY(); 
 if(we.getLocation().getX()==50 && we.getLocation().getY()==50) 
 else {
 System.out.print("In Valid"); 

Post a Comment

POST Answer of Questions and ASK to Doubt

Previous Post Next Post