This program is used to get the attributes from Google website.
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class Google { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); driver.get("https://www.google.co.in/"); String title = driver.findElement(By.xpath("//div[@id='hplogo']/a/img")).getAttribute("title"); System.out.println(title); driver.close(); } }The execution of the above program will look like as follows:
TODO
Very nice I gathered good information from this content.
ReplyDeleteSelenium training in chennai | Selenium testing training in chennai | Selenium training chennai | FITA Velachery