WebElement acceptText = driver.findElement(By.xpath(".//button[contains(text(),'Accept')]"));
acceptText.click();
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/bcae030c-7c23-4eb2-b373-432c8feb61bb%40googlegroups.com.
buttons = driver.findElement(By.className("eula-button"));
Hi,try below;List<WebElement> buttons= driver.findElements(By.className("dialog-button eula-button"));for(int i=0; i<buttons.size(); i++){WebElement button=buttons.get(i);String buttonName=button.getText();if(buttonName.equals("Accept")){button.click();}}}
On Wed, Nov 2, 2016 at 7:28 AM, viren patel <patel.v...@gmail.com> wrote:
WebElement acceptText = driver.findElement(By.xpath(".//button[contains(text(),'Accept')]"));
acceptText.click();
On Tuesday, November 1, 2016 at 6:32:29 PM UTC-5, Damita stathakis wrote:--Hi,I'm new to Javascript and Selenium so please bear with me!How would I locate the element 'Accept' and click it?I have tried a few combinations and I am currently on this:driver.findElement(By.css("button.dialog-button.eula-button")).click();But I get the no such element error.Thanks for any help!
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.