Let’s run some automated selenium tests in Firefox, without Firefox! 😉 In other words, tests run in the background and there is no display (i.e. the browser UI is not displayed to the user).Read More
Well, if your memory is better than mine, then you will remember that we have 8 locator types in Selenium WebDriver viz., ID, name, tag name, class name, link text, partial link text, CSS selector and XPath. The sad part is, even though we have these many locator types, it still gets challenging to locate an element, especially when the application under test is complex.Read More
This is a continuation of the article, ‘Using Log4j Part 1’ and hence, I suggest that you read part 1 before proceeding any further to get a grip on what’s happening. Scenario
- Configure Log4j.properties file,
- Log level – DEBUG
- Loggers – rootLogger and SeleniumTestLogger
- Appender – RollingFileAppender
- Layout – PatternLayout
- Write a JUnit4 test case, ‘Log4jTest.java’,
- Open Chrome browser.
- Navigate to the demo site
- Create an instance for the Logger class
- Log "opening selenium-practice-site" to test.log
- Locate ‘Bicycle’ checkbox by name and click on it
- Log "Bicycle checkbox selected"
- Locate ‘Magazines’ radio button using cssSelector and select it
- Log "Magazines radio button clicked"
- Log "Log4jTest executed successfully"
- Eclipse IDE console output screen
- JUnit pane for success result
- log and test.log files and check if logs are updated as expected
Let me take a stab at explaining logging for Selenium with Apache Log4j today! So, without further ado, let’s dive in!!
Why do we need logging in the first place?As an automation tester, we deal with troubleshooting, debugging and so on. Logging makes this entire process so much easier! It gives us these magical “eyes” that let us see a number of things such as, Read More
Lights, camera, action! Yes, today its all about Actions. Oh, I am not talking about those fight sequences you watch in movies but about the keyboard and mouse actions. :P Selenium WebDriver provides a user-facing API for performing complex user gestures. We want automation everywhere! So, instead of using keyboard and mouse directly, we can use Actions Class for performing both basic viz.,
sendKeys and complex actions such as
Hiya superstars! We have been locating elements for quite some days now. Let us switch gears and talk about “Assert and Verify” today.
To remember,The major difference between the two when the assert or verify condition/check fails is,
- Assert will fail the test and abort the execution of the current test case. All other test steps after that particular line of code are skipped
- Verify will log the failure but continue to execute the test case.
Ready to listen for some key codes on your keyboard and some mouse buttons using Vue? Let’s dig deep then! Make sure you read up on “Listening to DOM events and Event modifiers” if you haven’t already. Because this is more of a continuation to what we already saw.Read More