Scroll to top

Selenium

Posted by Chandana Chaitanya
January 13, 2020

10m. Advanced WebDriver – Running tests in headless mode

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
Posted by Chandana Chaitanya
December 31, 2019

9ac. WebDriver – Unable to locate an element easily? Read on...

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.
Continue Reading

Read More
Posted by Chandana Chaitanya
May 23, 2019

10l. Advanced WebDriver – Using Log4j Part 2

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" Verify, Eclipse IDE console output screen JUnit pane for success result log and test.log files and check if logs are updated as expected
Continue Reading

Read More
Posted by Chandana Chaitanya
May 19, 2019

10k. Advanced WebDriver – Using Log4j Part 1

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,
Continue Reading

Read More
Posted by Chandana Chaitanya
December 28, 2018

9ab. WebDriver – Using Actions Class

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., click, sendKeys and complex actions such as dragAndDrop etc.
Continue Reading

Read More
Posted by Chandana Chaitanya
December 14, 2018

9r. WebDriver – Assert and Verify

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.
Continue Reading

Read More
Posted by Chandana Chaitanya
September 23, 2018

9aa. WebDriver – Executing JavaScript code

Hiya Champs! Let’s have some quality interaction with the browser today!! So, can you guess the language that is preferred by the browser? Yes, you got that right. It is JavaScript indeed. If you are using Chrome, clicking on ‘F12’ will open the ‘Developer Tools’ which helps us to execute JavaScript directly from the browser. Certain actions such as scrolling, displaying alerts etc. become a lot easier to manage with JavaScript.
Continue Reading

Read More
Posted by Chandana Chaitanya
July 15, 2018

10j. Advanced WebDriver – Reading data from excel using POI

Hiya friends! Today, let us delve into excel sheets and understand how to read data…

Read More
Posted by Chandana Chaitanya
July 6, 2018

10i. Advanced WebDriver – Using property files

Hiya champions! Welcome back to another fun filled article which tells you why property files exist in the first place!! This particular concept is not just limited to Selenium WebDriver projects. It can be used in basically any Java project that involves hardcoded stuff. Imagine you have more than a couple hundred automated test cases and in each test case, you hard-coded the URL of the application under test. So far, so good. But, what if another release pops up changing the application URL to a different version and the same test cases are to be executed again (regression testing)? You might think, “That’s easy! I just have to run the build file one more time. Just one click and I will be back playing Super Mario!”. Did you miss the URL part? How much more pain it is, to manually go to every single test case and edit the hard-coded URL just to make it work? Oh no!!! Don’t fret! We have a solution. Property files come to our rescue! To make your test cases all the more dynamic, make sure you do not put any hard-coded values into them. Abstract out such values to a property file so that whenever they change, you can edit them in just one place and the test cases work perfectly all over again.
Continue Reading

Read More
Posted by Chandana Chaitanya
June 29, 2018

10h. Advanced WebDriver – Sending email with attachments

Hiya champs! Now that we have our JUnit report in PDF format let us attach it…

Read More