Log4j Log4j is a Framework(API) written in Java & distributed under Apache Software license, used for debugging. Log4j has 3 main components: 1. loggers: To capture the logging information 2. appenders: To publish the logging information to various destinations. An output destination is called an appender. 3. layouts: To format logging information in different styles. There are three ways to configure log4j: 1. Using properties file. 2. Using Java code programatically. 3. Using XML file. Configuring Log4j using properties files & programmatically Configuring log4j involves the following tasks: 1. Configuring the root logger 2. Configuring individual logger 3. Specifying appenders 4. Specifying message layout Configure the root logger The root logger is the base logger from which other loggers inherits. Syntax for configuring the root logger is as follows: log4j.rootLogger=level[, appender1, appender2…] Where level can be one of the f...
JQuery-Selectors: A JQuery selector is a function which makes use of expressions to find out matching elements from a DOM based on the given criteria. How to use selectors: The selectors are very usefull and would be required at every step while using JQuery. They get the exact element that you want from your HTML document. JQuery Selectors: Selector Example Selects * $("*") All elements #id $("#lastname") The element with id=lastname .class $(".intro") All elements with class="intro" Element $("p") All p elements .class, .class $(".intro, .demo") All elements with the classes "intro" and "demo" :first $("p:first") The first p element :last $("p:last") The last p element :even $("tr:even") All even tr elements :odd $("tr:odd") ...
Element Location Strategies using XPath, CSS & DOM Automating any application requires identification of the element & interact with it Locator are used for identifying the elements on the web page uniquely. There are so many ways to identify the elements in Selenium and those are called locators. Some of the most used and popular locators are XPath & CSS What is XPath? How do we use XPath in Elements identification? XPath (XML Path Language), is a query language for selecting nodes from an XML document. The XPath language is based on a tree representation of the XML document, and provides the ability to navigate around the tree, selecting nodes by a variety of criteria. XML contain one or more elements/tags/nodes An element may contain content/data or may contain other elements as child nodes. Each element should have starting tag and ending tag. The element content will reside in between these two tags. Apart from the content each tag may have ...
Comments
Post a Comment