Its not working
package module18;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class Dice {
public static void main(String[] args) throws Exception {
ChromeOptions chrOpt=new ChromeOptions();
chrOpt.addArguments("--disable-notification");
WebDriver driver=new ChromeDriver(chrOpt);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get("https://www.dice.com/");
driver.findElement(By.xpath("//input[@placeholder='Job title, skills or company']")).sendKeys("Selenium");
Thread.sleep(2000);
List<WebElement>options=driver.findElements(By.xpath("//div[@class='typeahead-menu-container ng-star-inserted']"));
System.out.println(options.size());
for(WebElement e:options){
System.out.println(e.getText());
if (e.getText().equals("selenium tester")) {
e.click();
System.out.println(e.getText());
break;
}
}
// driver.findElement(By.xpath("//input[@placeholder='Location (zip, city, state)']")).sendKeys("Hyderabad,India");
// driver.findElement(By.id("submitSearch-button")).click();
//
}
}
Instructor
Ashish Thakur Replied on 28/05/2020
I need to see screenshot of the error
Please always paste the screenshots of the errors.