Yes, i went through the video more than 2-3 times, but my bad i'm not able to resolve the issue. kindly help me,i''m stuck here with my practice
i have tried below code , printed only "hello"
WebDriver driver = new FirefoxDriver();
driver.get("https://yahoo.com");
driver.findElement(By.xpath("//*[@id='uh-search-box']")).sendKeys("Hello");
Thread.sleep(3000);
String res = driver.findElement(By.cssSelector("ul[id^='yui_3_18_0'] b")).getText();
System.out.println(res);
result is : hello
how to achieve complete text i.e.. hello adele
use below css selector:
String res = driver.findElement(By.cssSelector("ul[id^='yui_3_18_0'] li:nth-child(1)")).getText();