List of usage examples for org.openqa.selenium By cssSelector
public static By cssSelector(String cssSelector)
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void findElementByCSSSelector() { WebElement element = driver.findElement(By.cssSelector(".css-selector")); Assert.assertEquals("blabla", element.getText()); WebElement child = driver.findElement(By.cssSelector(".parent .child")); Assert.assertEquals("blubla", child.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void Element_findElementByCSSSelector() { WebElement parent = driver.findElement(By.cssSelector(".parent")); WebElement child = parent.findElement(By.cssSelector(".child")); Assert.assertEquals("blubla", child.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void findElementsByCSSSelector() { List<WebElement> elements = driver.findElements(By.cssSelector(".css-selector")); Assert.assertEquals(1, elements.size()); elements = driver.findElements(By.cssSelector(".some")); Assert.assertEquals(3, elements.size()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void Element_findElementsByCSSSelector() { WebElement parent = driver.findElement(By.cssSelector(".parent")); List<WebElement> elements = parent.findElements(By.cssSelector(".child")); Assert.assertEquals(2, elements.size()); elements = parent.findElements(By.cssSelector(".some")); Assert.assertEquals(2, elements.size()); }
From source file:com.easytox.automation.steps.addPhysicians.AddPhysiciansQuestSteps.java
@When("^Click on the Phisician icon on the LabClient list page for Quest lab$") public void click_on_the_Phisician_icon_on_the_LabClient_list_page_for_Quest_lab() throws Throwable { Thread.sleep(2000);/*from w w w . j av a2 s.c o m*/ WebElement table = driver.findElement(By.id("example")); List<WebElement> allRows = table.findElements(By.tagName("tr")); loop: { for (WebElement row : allRows) { List<WebElement> cells = row.findElements(By.xpath("./*")); for (WebElement cell : cells) { String cellText = cell.getText(); if (cellText.equals(LAB_CLIENT)) { WebElement icon = row.findElement(By.cssSelector(".fa.fa-user-md.fa-2x")); icon.click(); break loop; } } } } Thread.sleep(2000); }
From source file:com.easytox.automation.steps.addPhysicians.AddPhysiciansQuestSteps.java
@When("^Select '\\+' icon next to search box$") public void select_icon_next_to_search_box() throws Throwable { driver.findElement(By.cssSelector(".fa.fa-plus-circle.fa-2x")).click(); }
From source file:com.easytox.automation.steps.addPhysicians.AddPhysiciansQuestSteps.java
@When("^Select and add Compound Profile$") public void select_and_add_Compound_Profile() throws Throwable { Select dropdown = new Select(driver.findElement(By.id("profiles"))); dropdown.selectByIndex(1);/*ww w . java 2 s . co m*/ driver.findElement(By.cssSelector(".addProfile")).click(); Thread.sleep(2000); }
From source file:com.easytox.automation.steps.addPhysicians.AddPhysiciansQuestSteps.java
@When("^Select Lab Client Locations as 'Quest' and select Location as 'Quest' and add the location$") public void select_Lab_Client_Locations_as_Quest_and_select_Location_as_Quest_and_add_the_location() throws Throwable { Select dropdown = new Select(driver.findElement(By.id("labclientselect"))); dropdown.selectByVisibleText(LAB_CLIENT); Thread.sleep(1000);/*from w w w . jav a 2 s.c o m*/ dropdown = new Select(driver.findElement(By.id("lablocations"))); dropdown.selectByVisibleText(LAB_CLIENT); driver.findElement(By.cssSelector(".addLocation")).click(); Thread.sleep(2000); }
From source file:com.easytox.automation.steps.addPhysicians.AddPhysiciansQuestSteps.java
@When("^Enter the remaining information and click on 'Submit'$") public void enter_the_remaining_information_and_click_on_Submit() throws Throwable { Physician physician = initailizePhysician(); driver.findElement(By.name("user.firstName")).sendKeys(physician.getFirstName()); driver.findElement(By.name("user.middleIntial")).sendKeys(physician.getMiddleName()); driver.findElement(By.name("user.lastName")).sendKeys(physician.getLastName()); driver.findElement(By.name("user.medicalDegree")).sendKeys(physician.getMedicalDegree()); driver.findElement(By.name("user.contact")).sendKeys(physician.getPhoneNumber()); driver.findElement(By.name("user.email")).sendKeys(physician.getEmail()); driver.findElement(By.name("salutation")).sendKeys(physician.getSalutation()); driver.findElement(By.name("medicare_num")).sendKeys(physician.getMedicalNumber()); driver.findElement(By.name("medicaid_num")).sendKeys(physician.getMedicaidNumber()); driver.findElement(By.name("upin_num")).sendKeys(physician.getUpinNumer()); driver.findElement(By.name("state_license")).sendKeys(physician.getStateLicence()); driver.findElement(By.name("npi")).sendKeys(physician.getNpi()); Thread.sleep(2000);//from w w w . j av a 2 s . c om driver.findElement(By.cssSelector(".btn.btn-primary.btn-md")).click(); Thread.sleep(2000); }
From source file:com.easytox.automation.steps.addPhysicians.AddPhysiciansQuestSteps.java
@Then("^Physician should be added to the Phisicians list$") public void physician_should_be_added_to_the_Phisicians_list() throws Throwable { Thread.sleep(1000);/*from w ww .j a v a 2 s . c o m*/ driver.findElement(By.cssSelector(".alert.alert-success")); }