Selenium webdriver 如何使用selenium web驱动程序单击yahoo登录链接?

Selenium webdriver 如何使用selenium web驱动程序单击yahoo登录链接?,selenium-webdriver,Selenium Webdriver,(登录)这是雅虎登录的html标记。我想单击使用SeleniumWeb驱动程序登录,并获取title=“登录”中的值?任何人都可以解决我的问题。线程“main”org.openqa.selenium.NoSuchElementException中的异常:无法定位元素:{“method”:“xpath”,“selector”:“/*[@id='yui_3_12_0_1_14327266437479_842']”命令持续时间或超时:702毫秒感谢回复,我是按照你的指导写的,但我在控制台上发现了这个错

(登录)这是雅虎登录的html标记。我想单击使用SeleniumWeb驱动程序登录,并获取title=“登录”中的值?任何人都可以解决我的问题。

线程“main”org.openqa.selenium.NoSuchElementException中的异常:无法定位元素:{“method”:“xpath”,“selector”:“/*[@id='yui_3_12_0_1_14327266437479_842']”命令持续时间或超时:702毫秒感谢回复,我是按照你的指导写的,但我在控制台上发现了这个错误。让我问你几件事。你要找的那个按钮在哪里。你哪里有问题?1.打开Yahoo.com 2。单击“登录”按钮3。下一步是什么?我提供的解决方案只有在我打开www.yahoo.com并单击该登录按钮时才有效。当你打开yahoo.com时,它就在右上角。1)我想单击该按钮,2)登录雅虎主页。我在使用以下代码单击登录链接时遇到问题,我得到的结果是WebElement el=driver2.findElement(By.xpath(“/*[@id='yucs-profile']]/a/b”);String elementValue=el.getText()//这一个得到值el.click();
 WebElement el = driver.findElement(By.cssSelector(".social-enabled-txt"));
    String elementValue =  el.getText(); //This one gets the value 
      el.click(); // This one clicks on the signin button on yahoo.com homepage.