Friday, 4 August 2017

Code Example - Auto Suggestion

package com.seleniumWebdriver;

import org.openqa.selenium.By;
import org.testng.annotations.Test;

/**
 * @Blog Name : Selenium Code Example
 * @author Deepak Gupta
 * @Created Date 4-08-2017
 *
 */
public class AutoSuggestion extends SuperTestNG {

@Test
public void testAutoSuggestion() {
try {
driver.navigate().to("https://www.google.co.in/");
driver.findElement(By.id("lst-ib")).sendKeys("and");
Thread.sleep(2000);
driver.findElement(By.xpath("//b[text()='roid']")).click();

} catch (Exception e) {
e.printStackTrace();
}
}
}

No comments:

Post a Comment

Code Example - File Download By Robot Class In Firefox Browser

Exported from Notepad++ package com . practiceCode ; import java . awt . AWTException ; import java . awt . Robot ; import j...