Created
March 15, 2018 18:56
-
-
Save andreidbr/26d9ec15b01dc94dfcb81ef6b298d8fa to your computer and use it in GitHub Desktop.
A Selenium test to compare two CSS styles of an element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test(testName = "02 Clock Functionality Test", description = "Check that the 02 Clock page functions correctly", groups = {"02Clock"}) | |
public void verifyClockTest() throws InterruptedException { | |
driver.findElement(By.xpath("/html/body/div[2]/div[2]")).click(); | |
String firstStyle = driver.findElement(By.xpath("/html/body/div/div/div[3]")).getAttribute("style"); | |
Thread.sleep(2000); | |
String secondStyle = driver.findElement(By.xpath("/html/body/div/div/div[3]")).getAttribute("style"); | |
Assert.assertNotEquals(firstStyle, secondStyle, "There are no differences in the two styles"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment