问题
(Sign In) this is the html tag of yahoo sign in. I want to click on the sign in using selenium web driver, and also get the value which is in the title="sign in"? can anyone solve my problem please.
回答1:
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.
来源:https://stackoverflow.com/questions/30481762/how-to-click-on-the-yahoo-sign-in-link-using-selenium-web-driver