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
//compare two images | |
var diff = resemble(newImage).compareTo(originalImage).onComplete(function(comparisonData){ | |
console.log(comparisonData); | |
}); | |
// additional settings: | |
// diff.scaleToSameSize() — match the size of the new image to the baseline image; | |
// diff.ignoreAntialiasing() — ignore anti-aliasing (to minimize false positives); | |
// diff.ignoreColors() — ignore colors; |
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
driver.findElement(By.xpath("//*[contains(text(),'someText')]")); |
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
assertTrue(driver.findElement(By.cssSelector("BODY")).getText().matches("^[\\s\\S]* Your text here\r\n\r\n[\\s\\S]*$")); |
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
driver.getPageSource().contains(text); |
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
java -jar selenium-server-standalone-2.43.1.jar -Dwebdriver.chrome.driver=chromedriver.exe |
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
[ | |
{"nthOfType":1, "tagName":"BODY"} | |
{"id":"header", "nthOfType":1, "tagName":"DIV"}, | |
{"classes":["header__nav"], "nthOfClass":0, "nthOfType":1, "tagName":"UL"}, | |
{"classes":["nav__item"], "nthOfClass":0, "nthOfType":1, "tagName":"LI"}, | |
{"innerHTML":"Home", "nthOfType":1, "tagName":"A"} | |
] |
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
[ | |
{"tagName":"HTML"},{"nthOfType":1,"tagName":"BODY"}, | |
{"classes":["content-wrapper"],"nthOfClass":0,"nthOfType":1,"tagName":"DIV"}, | |
{"classes":["menu-left"],"nthOfClass":0,"nthOfType":1,"tagName":"DIV"}, | |
{"classes":["article", “full-width”],"nthOfClass":0,"nthOfType":1,"tagName":"DIV"} | |
] |
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
<ul id=“navigation-4815162342” class=“nav”> | |
<!-- list items --> | |
</ul> | |
WebElement navigation = browser.findElement(By.xpath(“//ul[contains(@id, ‘navigation’)]”)); |
NewerOlder