Skip to main content

Posts

Showing posts from March, 2015

Verify conditions synchronously with CasperJS / PhantomJS

Synchronously waiting for a condition to be met in CasperJS (during AJAX calls and dynamic content loading on the page), implementation of helper methods: And now we can dynamically verify that our startup dialog has some text (in case the text is loaded by an AJAX call some time after the dialog was called):

Maven pom.xml configuration file to execute Jmeter tests and generate HTML reports

Example of a Maven pom.xml file for execution of Jmeter tests that will automatically generate HTML reports and historical trends with pretty graphs with the help of a Chronos plugin. - Install Maven and make sure it works - Create some testmyapp.jmx Jmeter script and put it into ${basedir}/tests/ directory - Unpack the latest version of Jmeter into jmeter.home directory - And finally you execute the following commands ( -Dbuild.number parameter can be your build number and you can set it dynamically in your continuous integration system, this is just for convenience and even greater coolness of the script): Enjoy amazing HTML reports generated by Chronos!

Reliable way to click on WebElement in Selenium Webdriver

Introducing a more robust way to click on the WebElement in situations when the native WebDriver click method doesn't work for some unknown yet obscure and annoying reason. Example of implementation in C# is given below. Probably porting of this code to Java wouldn't take too much time as well. Everything you need is a getter method with a CSS selector, which is automatically converted into Xpath in generateXpath method, and then the click event is triggered using JavaScript evaluate in ClickJS method. Works like a charm, also makes my tests more robust, especially in a multithreaded mode.