WebDriver Commands

We can divide WebDriver Commands into three categories:
  • Browser Specific Commands
  • Browser Navigation Commands and,
  • Element Specific Commands
In this post we will discuss about 25 WebDriver commands which are used frequently in Selenium Automation:

Browser Specific Commands:

1. Maximize window:
To maximize a browser window, we need to call the maximize() method of the Window interface of the driver class. Add the second line right below where you define an instance of FirefoxDriver.
Example: 
driver = new FirefoxDriver(); 
driver.manage().window().maximize();

2. Delete cookies
Delete all the cookies for the current domain using deleteAllCookies() method.
Example:
driver.manage().deleteAllCookies();

Deleting the specific cookie with cookie name "--abcd"
driver.manage().deleteCookieNamed("__abcd");

3. Get command:
The command launches a new browser and opens the specified URL in the browser instance
The command takes a single string type parameter that is usually a URL of application under test.
Example: driver.get("https://google.com");

4. GetTitle:
The command is used to retrieve the title of the webpage the user is currently working on. A null string is returned if the webpage has no title.
The command doesn’t require any parameter and returns a trimmed string value. 
Example: String title = driver.getTitle();

5. GetCurrentUrl:
The command is used to retrieve the URL of the webpage the user is currently accessing 
The command doesn’t require any parameter and returns a string value.
Example: driver.getCurrentUrl();

6. GetPageCource:
The command is used to retrieve the page source of the webpage the user is currently accessing.
The command doesn’t require any parameter and returns a string value. The command can be used with various string operations like contains() to ascertain the presence of the specified string value.
Example:
boolean result = driver.getPageSource().contains("String to find");

7. Close:
WebDriver’s close() method closes the web browser window that the user is currently working on or we can also say the window that is being currently accessed by the WebDriver. The command neither requires any parameter nor does it return any value.
Example:
driver.close();

8. Quit
Unlike close() method, quit() method closes down all the windows that the program has opened. Same as close() method, the command neither requires any parameter nor does it return any value.
Example:
driver.quit();

Please refer below youtube video on Browser Specific commands:



Browser Navigation Commands:

WebDriver provides some basic Browser Navigation Commands that allows the browser to move backwards or forwards in the browser's history.

1. Navigate To:
Method - String to(String arg0)
In WebDriver, this method loads a new web page in the existing browser window. It accepts String as parameter and returns void. The respective command to load/navigate a new web page can be written as:
Example:
driver.navigate().to("www.automationtestinginsider.com");  

2. Backward:
Method - void back()
This method enables the web browser to click on the back button in the existing browser window. It neither accepts anything nor returns anything. The respective command that takes you back by one page on the browser's history can be written as:
Example:
driver.navigate().back(); 

3. Forward:
Method - void forward()
This method enables the web browser to click on the forward button in the existing browser window. It neither accepts anything nor returns anything. The respective command that takes you forward by one page on the browser's history can be written as:
Example:
driver.navigate().forward();  

4. Refresh:
Method - void refresh()
In WebDriver, this method refresh/reloads the current web page in the existing browser window. It neither accepts anything nor returns anything. The respective command that takes you back by one page on the browser's history can be written as:
Example:
driver.navigate().refresh();

Please refer below youtube video on Browser Navigation commands:



Element Specific Commands:

1. Clear:
clear( ) predefined method of  Selenium 'WebDriver' Class is used to clear the text entered or displayed in the text fields
Example: driver.findElement(By.id("userName")).sendKeys("Admin").clear();

2. Click:
The click command emulates a click operation for a link, button, checkbox or radio button. In Selenium Webdriver, execute click after finding an element.
Example: driver.findElement(By.id("button")).click();

3. getText:
The command is used to retrieve the inner text of the specified web element. The command doesn’t require any parameter and returns a string value:
Example:  String elementText = driver.findElement(By.id("Text")).getText();

4. IsSelected:
isSelected() is the method used to verify if the web element is selected or not.
Example: boolean ele= driver.findElement(By.id("button")).isSelected();
         
5. IsEnabled:
isEnabled() is the method used to verify if the web element is enabled or disabled within the webpage. isEnabled() is primarily used with buttons. 
Example: boolean ele= driver.findElement(By.id("button")).isEnabled();

6. IsDisplayed:
isDisplayed() is the method used to verify a presence of a web element within the webpage. The method returns a “true” value if the specified web element is present on the web page and a “false” value if the web element is not present on the web page.
Example: boolean ele= driver.findElement(By.id("button")).IsDisplayed();

7. getAttribute:
The command is used to retrieve the value of the specified attribute. The command requires a single string parameter that refers to an attribute whose value we aspire to know and returns a string value. as a result.
Example: driver.findElement(By.id("findID")).getAttribute("value");

8. sendkeys:
This is a method for sending one or more keystrokes to the active window
Example: driver.findElement(By.id("userName")).sendKeys("Admin")

9. Submit:
submit() is used to click Button in Web page. Selenium Webdriver has one special method to submit any form and that method name Is submit(). You can use .click() method to click on any button.There is no restriction for click buttons. We can use .submit() method for only submit form after click on button. That means element's type = "submit" and button should be inside <form> tag, then only submit() will work.

10. getSize: 
It will returns the "Dimension" object. If you want to get the width and Height of the specific element on the webpage then use "getsize()" method.

11. getCssValue: - getCssValue method in selenium fetches the value of a CSS property of an web element.

12. getLocation: 
In Selenium WebDriver APIs, there is a method getLocation() which returns point, containing location of top left hand corner of the element. Let's say, it returns (x, y).

13. getTagname: 
This method gets the tag name of this element. This accepts nothing as a parameter and returns a String value. Command – element.getTagName();




Capital Market Questions and Answers

1. What is Investment banking?

Answer: An investment bank is a financial institution that assists individuals, corporations and governments in raising capital by underwriting and/or acting as the client's agent in the issuance of securities. An investment bank may also assist companies involved in mergers and acquisitions, and provide ancillary services such as market making, trading of derivatives, fixed income instruments, foreign exchange, commodities, and equity securities.

Unlike commercial banks and retail banks, investment banks do not take deposits.

There are two main lines of business in investment banking. Trading securities for cash or for other securities (i.e., facilitating transactions, market-making), or the promotion of securities (i.e., underwriting, research, etc.) is the "sell side", while dealing with pension funds, mutual funds, hedge funds, and the investing public (who consume the products and services of the sell-side in order to maximize their return on investment) constitutes the "buy side". Many firms have buy and sell side components.

2. What are the Primary and Secondary markets?

Answer: Primary Market:  The primary market is that part of the capital markets that deals with the issuance of new securities. Companies, governments or public sector institutions can obtain funding through the sale of a new stock or bond issue. This is typically done through a syndicate of securities dealers. The process of selling new issues to investors is called underwriting. In the case of a new stock issue, this sale is an initial public offering (IPO). Dealers earn a commission that is built into the price of the security offering, though it can be found in the prospectus. Primary markets creates long term instruments through which corporate entities borrow from capital market.
Features of primary markets are:
This is the market for new long term equity capital. The primary market is the market where the securities are sold for the first time. Therefore it is also called the new issue market (NIM).
In a primary issue, the securities are issued by the company directly to investors.
The company receives the money and issues new security certificates to the investors.
Primary issues are used by companies for the purpose of setting up new business or for expanding or modernizing the existing business.
The primary market performs the crucial function of facilitating capital formation in the economy.
The new issue market does not include certain other sources of new long term external finance, such as loans from financial institutions. Borrowers in the new issue market may be raising capital for converting private capital into public capital; this is known as "going public."
The financial assets sold can only be redeemed by the original holder.

Methods of issuing securities in the primary market are:
Initial public offering;
Rights issue (for existing companies);
Preferential issue.


Secondary Market:  The secondary market, also called aftermarket, is the financial market where previously issued securities and financial instruments such as stock, bonds, options, and futures are bought and sold.

With primary issuances of securities or financial instruments, or the primary market, investors purchase these securities directly from issuers such as corporations issuing shares in an IPO or private placement, or directly from the federal government in the case of treasuries. After the initial issuance, investors can purchase from other investors in the secondary market.
The secondary market for a variety of assets can vary from loans to stocks, from fragmented to centralized, and from illiquid to very liquid. The major stock exchanges are the most visible example of liquid secondary markets - in this case, for stocks of publicly traded companies. Exchanges such as the New York Stock Exchange, Nasdaq and the American Stock Exchange provide a centralized, liquid secondary market for the investors who own stocks that trade on those exchanges. Most bonds and structured products trade “over the counter,” or by phoning the bond desk of one’s broker-dealer. Loans sometimes trade online using a Loan Exchange.
Functions of Secondary market:  Secondary marketing is vital to an efficient and modern capital market.

In the secondary market, securities are sold by and transferred from one investor or speculator to another. It is therefore important that the secondary market be highly liquid (originally, the only way to create this liquidity was for investors and speculators to meet at a fixed place regularly; this is how stock exchanges originated, see History of the Stock Exchange). As a general rule, the greater the number of investors that participate in a given marketplace, and the greater the centralization of that marketplace, the more liquid the market.
Fundamentally, secondary markets mesh the investor's preference for liquidity (i.e., the investor's desire not to tie up his or her money for a long period of time, in case the investor needs it to deal with unforeseen circumstances) with the capital user's preference to be able to use the capital for an extended period of time.
Accurate share price allocates scarce capital more efficiently when new projects are financed through a new primary market offering, but accuracy may also matter in the secondary market because: 1) price accuracy can reduce the agency costs of management, and make hostile takeover a less risky proposition and thus move capital into the hands of better managers, and 2) accurate share price aids the efficient allocation of debt finance whether debt offerings or institutional borrowing.


3.  Difference between Primary and Secondary markets.

Answer: In the primary market, securities are offered to public for subscription for the purpose of raising capital or fund. Secondary market is an equity trading venue in which already existing/pre-issued securities are traded among investors. Secondary market could be either auction or dealer market. While stock exchange is the part of an auction market, Over-the-Counter (OTC) is a part of the dealer market.


4. What is IPO?

Answer:
Classification Of Issues
An initial public offering (IPO), referred to simply as an "offering" or "flotation", is when a company (called the issuer) issues common stock or shares to the public for the first time. They are often issued by smaller, younger companies seeking capital to expand, but can also be done by large privately owned companies looking to become publicly traded.
In an IPO the issuer obtains the assistance of an underwriting firm, which helps determine what type of security to issue (common or preferred), best offering price and time to bring it to market.
Reasons for listings:  When a company lists its securities on a public exchange, the money paid by investors for the newly-issued shares goes directly to the company (in contrast to a later trade of shares on the exchange, where the money passes between investors). An IPO, therefore, allows a company to tap a wide pool of investors to provide it with capital for future growth, repayment of debt or working capital. A company selling common shares is never required to repay the capital to investors.
Once a company is listed, it is able to issue additional common shares via a secondary offering, thereby again providing itself with capital for expansion without incurring any debt. This ability to quickly raise large amounts of capital from the market is a key reason many companies seek to go public.
There are several benefits to being a public company, namely:
Bolstering and diversifying equity base
Enabling cheaper access to capital
Exposure, prestige and public image
Attracting and retaining better management and employees through liquid equity participation
Facilitating acquisitions
Creating multiple financing opportunities: equity, convertible debt, cheaper bank loans, etc.
Increased liquidity for equity holder
Disadvantages of an IPO: There are several disadvantages to completing an initial public offering, namely:
Significant legal, accounting and marketing costs
Ongoing requirement to disclose financial and business information
Meaningful time, effort and attention required of senior management
Risk that required funding will not be raised
Public dissemination of information which may be useful to competitors, suppliers and customers.

5. What are share, stock, bond?

Answer: 

Share:  A joint stock company divides it's capital into units of equal denomination. Each unit is called a share. These units are offered for sale to raise capital. This is termed as issuing shares. A person who buys share/shares of the company is called a shareholder, and by acquiring share or shares in the company becomes one of the owners of the company. Thus, a share is an indivisible unit of capital. It expresses the proprietary relationship between the company and the shareholder. The denominated value of a share is its face value: the total capital of a company is divided into number of shares.

Stock: The capital stock (or just stock) of a business entity represents the original capital paid into or invested in the business by its founders. It serves as a security for the creditors of a business since it cannot be withdrawn to the detriment of the creditors. Stock is different from the property and the assets of a business which may fluctuate in quantity and value.

Types of Stock: Stock typically takes the form of shares of either common stock or preferred stock. As a unit of ownership, common stock typically carries voting rights that can be exercised in corporate decisions. Preferred stock differs from common stock in that it typically does not carry voting rights but is legally entitled to receive a certain level of dividend payments before any dividends can be issued to other shareholders.[3][4] Convertible preferred stock is preferred stock that includes an option for the holder to convert the preferred shares into a fixed number of common shares, usually anytime after a predetermined date. Shares of such stock are called "convertible preferred shares" (or "convertible preference shares" in the UK)

Bond: In finance, a bond is a debt security, in which the authorized issuer owes the holders a debt and, depending on the terms of the bond, is obliged to pay interest (the coupon) to use and/or to repay the principal at a later date, termed maturity. A bond is a formal contract to repay borrowed money with interest at fixed intervals.[1]
Thus a bond is like a loan: the holder of the bond is the lender (creditor), the issuer of the bond is the borrower (debtor), and the coupon is the interest. Bonds provide the borrower with external funds to finance long-term investments, or, in the case of government bonds, to finance current expenditure. Certificates of deposit (CDs) or commercial paper are considered to be money market instruments and not bonds.
Bonds and stocks are both securities, but the major difference between the two is that (capital) stockholders have an equity stake in the company (i.e., they are owners), whereas bondholders have a creditor stake in the company (i.e., they are lenders). Another difference is that bonds usually have a defined term, or maturity, after which the bond is redeemed, whereas stocks may be outstanding indefinitely. An exception is a consol bond, which is a perpetuity (i.e., bond with no maturity).

6. What are the different exchanges in India?
Answer: Operating stock exchanges:
Bombay Stock Exchange (BSE) in Mumbai,
National Stock Exchange of India (NSE) in Mumbai,
Calcutta Stock Exchange in Kolkata, a smaller stock exchange
India International Exchange (INX)
Metropolitan Stock Exchange

Former stock exchanges
Ahmedabad Stock Exchange (closed in 2018)
Delhi Stock Exchange (closed in 2017)
Guwahati/Gauhati Stock Exchange (closed in 2015)
Jaipur Stock Exchange (closed in 2015)
Madhya Pradesh Stock Exchange (closed in 2015)
Madras Stock Exchange (MSE) (closed in 2015)
OTC Exchange of India (closed in 2015)
Pune Stock Exchange, was located in Pune (closed in 2015)
UP Stock Exchange (closed in 2015)
Vadodara Stock Exchange (closed in 2015)
Bangalore Stock Exchange (closed in 2014)
Cochin Stock Exchange, was located in Kochi (trading stopped in 2005, closed in 2014)
Inter-connected Stock Exchange of India (closed in 2014)
Ludhiana Stock Exchange (closed in 2014)
Bhubaneshwar Stock Exchange (closed in 2005)
Coimbatore Stock Exchange (requested exiting trading in 2009)
Hyderabad Stock Exchange (closed in 2007)
Magadh Stock Exchange (closed in 2007)
Mangalore Stock Exchange (closed in 2004)

7. What are index, Sensex and nifty?

Answer: Index:  A stock market index is a method of measuring a section of the stock market. Many indices are cited by news or financial services firms and are used as benchmarks, to measure the performance of portfolios such as mutual funds.
An index may also be considered as an instrument (after all it can be traded) which derives its value from other instruments or indices. The index may be weighted to reflect the market capitalization of its components, or may be a simple index which merely represents the net change in the prices of the underlying instruments.

Most publicly quoted stock market indices (like the two quoted below) are weighted.
Sensex
Nifty

Nifty has shaped up as the largest single financial product in India, with an ecosystem comprising: exchange traded funds (onshore and offshore), exchange-traded futures and options (at NSE in India and at SGX and CME abroad), other index funds and OTC derivatives (mostly offshore).

8. How Sensex and nifty does compute?

Answer: Sensex = (Summation of Market capitalization of 30 scrip’s / Base Market capitalization) *base value
Where Market capitalization = free float share * LTP

9. What is Equity or Cash market?
Cash market: The spot market or cash market is a public financial market, in which financial instruments or commodities are traded for immediate delivery. It contrasts with a futures market in which delivery is due at a later date. A spot market can be:
an organized market, an exchange or
"over the counter", OTC.
Spot markets can operate wherever the infrastructure exists to conduct the transaction. The spot market for most instruments exists primarily on the Internet.

10. Difference between equity and derivative market.
11. What are the different types of orders?

An order in a market such as a stock market, bond market, commodity market or financial derivative market is an instruction from customers to brokers to buy or sell on the exchange. These instructions can be simple or complicated. There are some standard instructions for such orders.
Market order
A market order is a buy or sell order to be executed immediately at current market prices. As long as there are willing sellers and buyers, market orders are filled. Market orders are therefore used when certainty of execution is a priority over price of execution.
A market order is the simplest of the order types. This order type does not allow any control over the price received. The order is filled at the best price available at the relevant time. In fast-moving markets, the price paid or received may be quite different from the last price quoted before the order was entered.
A market order may be split across multiple participants on the other side of the transaction, resulting in different prices for some of the shares.
Limit order:
A limit order is an order to buy a security at not more, or sell at not less, than a specific price. This gives the trader control over the price at which the trade is executed; however, the order may never be executed ("filled").Limit orders are used when the trader wishes to control price rather than certainty of execution.
A buy limit order can only be executed at the limit price or lower. For example, if an investor wants to buy a stock, but doesn't want to pay more than $20 for it, the investor can place a limit order to buy the stock at $20 "or better". By entering a limit order rather than a market order, the investor will not buy the stock at a higher price, but, may get fewer shares than he wants or not get the stock at all.
A sell limit order is analogous; it can only be executed at the limit price or higher.
Both buy and sell orders can be additionally constrained. Two of the most common additional constraints are Fill Or Kill (FOK) and All Or None (AON). FOK orders are either filled completely on the first attempt or canceled outright, while AON orders stipulate that the order must be filled with the entire number of shares specified, or not filled at all. If it is not filled, it is still held on the order book for later execution.
Time in force
A day order or good for day order (GFD) (the most common) is a market or limit order that is in force from the time the order is submitted to the end of the day's trading session. For equity markets, the closing time is defined by the exchange. For the foreign exchange market, this is until 5pm EST/EDT for all currencies except NZD.
A good-till-cancelled (GTC) order requires a specific cancelling order. It can persist indefinitely (although brokers may set some limits, for example, 90 days).
An immediate-or-cancel order (IOC) will be immediately executed or cancelled by the exchange. Unlike a fill-or-kill order, IOC orders allow for partial fills.
Fill-or-kill orders (FOK) are usually limit orders that must be executed or cancelled immediately. Unlike IOC orders, FOK orders require the full quantity to be executed.
Stop Loss orders
A stop order (also stop loss order) is an order to buy (or sell) a security once the price of the security has climbed above (or dropped below) a specified stop price. (Note that both bid and ask prices can trigger a stop order.) When the specified stop price is reached, the stop order is entered as a market order (no limit). This means the trade will definitely be executed, but not necessarily at or near the stop price, particularly when the order is placed into a fast-moving market, or if there is insufficient liquidity available relative to the size of the order.
The use of stop orders is much more frequent for stocks and futures that trade on an exchange than those that trade in the over-the-counter (OTC) market.
A sell stop order is an instruction to sell at the best available price after the price goes below the stop price. A sell stop price is always below the current market price. For example, if an investor holds a stock currently valued at $50 and is worried that the value may drop, he/she can place a sell stop order at $40. If the share price drops to $40, the broker sells the stock at the next available price. This can limit the investor's losses (if the stop price is at or above the purchase price) or lock in some of the investor's profits.
A buy stop order is typically used to limit a loss (or to protect an existing profit) on a short sale.A buy stop price is always above the current market price. For example, if an investor sells a stock short—hoping for the stock price to go down so they can return the borrowed shares at a lower price (Covering)—the investor may use a buy stop order to protect against losses if the price goes too high. It can also be used to advantage in a declining market when you want to enter a long position close to the bottom after turn-around.
A stop limit order combines the features of a stop order and a limit order. Once the stop price is reached, the stop-limit order becomes a limit order to buy (or to sell) at no more (or less) than another, pre-specified limit price.As with all limit orders, a stop-limit order doesn't get filled if the security's price never reaches the specified limit price.
A trailing stop order is entered with a stop parameter that creates a moving or trailing activation price, hence the name. This parameter is entered as a percentage change or actual specific amount of rise (or fall) in the security price. Trailing stop sell orders are used to maximize and protect profit as a stock's price rises and limit losses when its price falls. Trailing stop buy orders are used to maximize profit when a stock's price is falling and limit losses when it is rising.
For example, a trader has bought stock ABC at $10.00 and immediately places a trailing stop sell order to sell ABC with a $1.00 trailing stop. This sets the stop price to $9.00. After placing the order, ABC doesn't exceed $10.00 and falls to a low of $9.01. The trailing stop order is not executed because ABC has not fallen $1.00 from $10.00. Later, the stock rises to a high of $15.00 which resets the stop price to $14.00. It then falls to $14.00 ($1.00 from its high of $15.00) and the trailing stop sell order is entered as a market order.
A trailing stop limit order is similar to a trailing stop order. Instead of selling at market price when triggered, the order becomes a limit order.
A trailing stop trailing limit order is the most flexible possible order.

12. What is market order?
Market order
A market order is a buy or sell order to be executed immediately at current market prices. As long as there are willing sellers and buyers, market orders are filled. Market orders are therefore used when certainty of execution is a priority over price of execution.
A market order is the simplest of the order types. This order type does not allow any control over the price received. The order is filled at the best price available at the relevant time. In fast-moving markets, the price paid or received may be quite different from the last price quoted before the order was entered.
A market order may be split across multiple participants on the other side of the transaction, resulting in different prices for some of the shares.

13. What is limit order?

A limit order is an order to buy a security at not more, or sell at not less, than a specific price. This gives the trader control over the price at which the trade is executed; however, the order may never be executed ("filled").Limit orders are used when the trader wishes to control price rather than certainty of execution.
A buy limit order can only be executed at the limit price or lower. For example, if an investor wants to buy a stock, but doesn't want to pay more than $20 for it, the investor can place a limit order to buy the stock at $20.

14. What is stop loss order, what are the conditions (rules) for stop loss?

Conditions:  For buy stop loss order -- > Limit Price>= Trigger Price
                      For Sell stop loss order -- > Limit Price<= Trigger Price
For Trigger SL order:
                      To execute buy stop loss order -- > LTP>= Trigger Price
                      For Sell stop loss order -- > LTP<= Trigger Price
 
15. Example of stop loss orders?
16. What are IOC, AON, GTC and GTD orders?

A good-till-cancelled (GTC) order requires a specific cancelling order. It can persist indefinitely (although brokers may set some limits, for example, 90 days).
An immediate-or-cancel order (IOC) will be immediately executed or cancelled by the exchange. Unlike a fill-or-kill order, IOC orders allow for partial fills.
Fill-or-kill orders (FOK) are usually limit orders that must be executed or cancelled immediately. Unlike IOC orders, FOK orders require the full quantity to be executed.

17. What are block deal orders?
Block Deal orders are meant for BULK trading or negotiated deals between two clients/traders for Quantity above 5 lakh or value above 5 crore. Lifetime of a Block Deal is only 90 sec. Block deals are allowed only in first 35 minutes of continuous session. (i.e. from 09:55 to 10:30)

18. What are odd lot orders?
Odd Lot is mainly used for trading physical shares. No partial trading of Quantity can be done with Odd lot. The Quantity need not be a multiple of MktLot nor should it be equal to MktLot (Only exception is for MktLot =1,the quantity can be equal to 1). Members can trade odd lot only for CLIENTS, NRI & OWN.

19. What are basket orders?
20. What are AMO orders?
21. What are CFDs?

In finance, a contract for difference (or CFD) is a contract between two parties, typically described as "buyer" and "seller", stipulating that the buyer will pay to the seller the difference between the current value of an asset and its value at contract time. (If the difference is negative, then the seller pays instead to the buyer.) In effect CFDs are financial derivatives that allow traders to take advantage of prices moving up (long positions) or prices moving down (short positions) on underlying financial instruments and are often used to speculate on those markets.
For example, when applied to equities, such a contract is an equity derivative that allows traders to speculate on share price movements, without the need for ownership of the underlying shares.
CFDs are currently available in the United Kingdom, The Netherlands, Poland, Portugal, Germany, Switzerland, Italy, Singapore, South Africa, Australia, Canada, New Zealand, Sweden, Norway, France, Ireland, Japan and Spain. They are not permitted in the United States, due to restrictions by the U.S. Securities and Exchange Commission on over-the-counter (OTC) financial instruments.

22. What is derivative market?

A derivative is a financial instrument whose value depends on underlying variables. The most common derivatives are futures, options, and swaps but may also include other tradeable assets such as a stock or commodity or non-tradeable items such as the temperature (in the case of weather derivatives), the unemployment rate, or any kind of (economic) index. A derivative is essentially a contract whose payoff depends on the behavior of a benchmark.
One of the oldest derivatives is rice futures, which have been traded on the Dojima Rice Exchange since the eighteenth century.
Derivatives are broadly categorized by the relationship between the underlying asset and the derivative (e.g., forward, option, swap); the type of underlying asset (e.g., equity derivatives, foreign exchange derivatives, interest rate derivatives, commodity derivatives, or credit derivatives); the market in which they trade (e.g., exchange-traded or over-the-counter); and their pay-off profile.
Derivatives can be used for speculating purposes ("bets") or to hedge ("insurance"). For example, a speculator may sell deep in-the-money naked calls on a stock, expecting the stock price to plummet, but exposing himself to potentially unlimited losses. Very commonly, companies buy currency forwards in order to limit losses due to fluctuations in the exchange rate of two currencies.

23. Difference between equity and derivative?
24. How many types of derivative product are there?
25. What are Forward, Future and Options?
26. What are Future contracts explain with example?
27. What are Option contracts explain with example?
28. What are warrants?

In finance, a warrant is a security that entitles the holder to buy the underlying stock of the issuing company at a fixed exercise price until the expiry date.
Warrants and options are similar in that the two contractual financial instruments allow the holder special rights to buy securities. Both are discretionary and have expiration dates. The word warrant simply means to "endow with the right", which is only slightly different to the meaning of an option.
Warrants are frequently attached to bonds or preferred stock as a sweetener, allowing the issuer to pay lower interest rates or dividends. They can be used to enhance the yield of the bond, and make them more attractive to potential buyers. Warrants can also be used in private equity deals. Frequently, these warrants are detachable, and can be sold independently of the bond or stock.
In the case of warrants issued with preferred stocks, stockholders may need to detach and sell the warrant before they can receive dividend payments. Thus, it is sometimes beneficial to detach and sell a warrant as soon as possible so the investor can earn dividends.
Warrants are actively traded in some financial markets such as Deutsche Börse and Hong Kong.In Hong Kong Stock Exchange, warrants accounted for 11.7% of the turnover in the first quarter of 2009, just second to the callable bull/bear contract.

29. What is Call option? Give an example.
30. What is put option? Give an example.
31. Difference between call and put?

Answer:
Call Option Vs Put Option
32. What are the ITM, OTM and ATM options?

When Is A Call Option In The Money ( ITM )?

A call option is considered In The Money ( ITM ) when the call option's strike price is lower than the prevailing market price of the underlying stock, thus allowing its owner to buy the underlying stock at lower than the prevailing market price by exercising the call option.
  In The Money Option with strike price extremely close to the strike price is also known as "Near The Money Option".
Example : If GOOG is trading at $300, it's $200 strike call options are In The Money ( ITM ) as it allows one to buy GOOG at $200 when it is trading at $300 now. The $200 strike call options therefore has an intrinsic value of $100.

Here is a table explaining the status of a call option against its underlying stock:
Assume GOOG trading at $300 now.
Call Option Status Strike Price
ITM                 $200
ATM                 $300
OTM                 $400


When Is A Put Option In The Money ( ITM )?

A put option is considered In The Money ( ITM ) when the put option's strike price is higher than the prevailing market price of the underlying stock, thus allowing its owner to sell the underlying stock at higher than the prevailing market price by exercising the put option.

Example : If GOOG is trading at $300, it's $400 strike put options are In The Money ( ITM ) as it allows one to sell GOOG at $400 when it is trading at $300 now. The $400 strike call options therefore has an intrinsic value of $100.

Here is a table explaining the status of a put option against its underlying stock :
Assume GOOG trading at $300 now.
Put Option Status Strike Price
OTM                  $200
ATM                  $300
ITM                  $400

When Is A Call Option Out Of The Money ( OTM )?

A call option is considered Out Of The Money ( OTM ) when the call option's strike price is higher than the prevailing market price of the underlying stock. It confers you the right to buy the underlying stock at a HIGHER price than the prevailing stock price and hence it has no intrinsic value. Such a call option will gain in value very quickly should the underlying stock rally above it's strike price. As it has completely no intrinsic value and requires the underlying stock to gain in price significantly in order to realise a profit, it is also the cheapest to buy in terms of absolute dollars.
  Out of The Money Option with strike price extremely close to the strike price is also known as "Near The Money Option".

Example : If GOOG is trading at $300, it's $400 strike call options are Out Of The Money ( OTM ) as it allows one to buy GOOG at $400 when it is trading at only $300 now.

Here is a table explaining the status of a call option against its underlying stock :
Assume GOOG trading at $300 now.
Call Option Status Strike Price
ITM                  $200
ATM                  $300
OTM                  $400

When Is A Put Option Out Of The Money ( OTM )?

A put option is considered Out Of The Money ( OTM ) when the put option's strike price is lower than the prevailing market price of the underlying stock. This allows you to sell the undelying stock for lower than the prevailing market price which will not make any sense and therefore contains no intrinsic value.

Example : If GOOG is trading at $300, it's $200 strike put options are Out Of The Money ( OTM ) as it allows one to sell GOOG at $200 when it is trading at $300 now.

Here is a table explaining the status of a put option against its underlying stock :
Assume GOOG trading at $300 now.
Put Option Status Strike Price
OTM                 $200
ATM                 $300
ITM                 $400

At The Money Options ( ATM ) Introduction

At The Money Options ( ATM ) is one of the three option moneyness states that all option traders have to be familar with before considering actual options trading. The other two option moneyness states are : Out Of The Money ( OTM ) options and In The Money ( ITM ) options.

Understanding how options are priced makes this topic easier to understand.

In fact, trading At The Money Options ( ATM ) is the most fundamental options trading method available which gives a very good risk / reward balance.

Learn how to trade At The Money options.

For example, if QQQQ is trading at $50, it's $50 strike price call and put options are At The Money. Usually, this situation is very rare as stock prices changes every single minute. Industry experts usually refer to strike prices within a few cents of the prevailing stock price as At The Money too. At The Money is also the only status where both call option and put option occurs together. Usually, when a call option is In The Money ( ITM ), the same strike put option would be Out Of The Money ( OTM ) and when a put option is In The Money ( ITM ), the same strike call option would be Out Of The Money ( OTM ). But, when a call option is At The Money, the same strike put option would also be At The Money.

A strictly At The Money option, like in the above example, would contain only extrinsic value and no intrinsic value. Also, as At The Money options have the equal potential to expire In The Money ( ITM ) or Out Of The Money ( OTM ), their Delta Value is usually equal to or very near 0.50. Because an option is only At The Money when its strike price is exactly the same as the spot price of the underlying stock, most "At The Money" options are actually only "Near The Money".

33. What is strike price, spot price?
Strike Price: The price at which a specific derivative contract can be exercised. Strike prices is mostly used to describe stock and index options, in which strike prices are fixed in the contract. For call options, the strike price is where the security can be bought (up to the expiration date), while for put options the strike price is the price at which shares can be sold.

The difference between the underlying security's current market price and the option's strike price represents the amount of profit per share gained upon the exercise or the sale of the option. This is true for options that are in the money; the maximum amount that can be lost is the premium paid.

Also known as the "exercise price".
Spot Price:  The current price at which a particular commodity can be bought or sold at a specified time and place.

34. What is calendar spread?

In finance, a calendar spread (also called a time spread or horizontal spread) is a spread trade involving the simultaneous purchase of futures or options expiring at particular date and the sale of the same instrument expiring another date. The legs of the spread vary only in expiration date; they are based on the same underlying market and strike price.
The usual case involves the purchase of futures or options expiring in a more distant month and the sale of futures or options in a more nearby month.[citation needed]

35. How does bullish and bearer happened??

A primary trend has broad support throughout the entire market (most sectors) and lasts for a year or more.
Bull market
A bull market is associated with increasing investor confidence, and increased investing in anticipation of future price increases (capital gains). A bullish trend in the stock market often begins before the general economy shows clear signs of recovery.
Examples
India's Bombay Stock Exchange Index, SENSEX, was in a bull market trend for about five years from April 2003 to January 2008 as it increased from 2,900 points to 21,000 points. A notable bull market was in the 1990s and most of the 1980s when the U.S. and many other stock markets rose; the end of this time period sees the dot-com bubble.
Bear market
A bear market is a general decline in the stock market over a period of time.It is a transition from high investor optimism to widespread investor fear and pessimism. According to The Vanguard Group, "While there’s no agreed-upon definition of a bear market, one generally accepted measure is a price decline of 20% or more over at least a two-month period." It is sometimes referred to as "The Heifer Market" due to the paradox with the above subject.
Examples
A bear market followed the Wall Street Crash of 1929 and erased 89% (from 386 to 40) of the Dow Jones Industrial Average's market capitalization by July 1932, marking the start of the Great Depression. After regaining nearly 50% of its losses, a longer bear market from 1937 to 1942 occurred in which the market was again cut in half. Another long-term bear market occurred from about 1973 to 1982, encompassing the 1970s energy crisis and the high unemployment of the early 1980s. Yet another bear market occurred between March 2000 and October 2002. The most recent example occurred between October 2007 and March 2009.

36. Explain Trade life cycle with each phase?
37. What is clearing?
38. What are clearing banks?
39. What is Settlement cycle?
40. Who ensures the settlement?
41. What is cash settlement?
42. What is delivery based settlement?
43. What is clearing corporation, its functions?
44. What does “Novation” means?
45. What does pay-in means? For securities and funds.
46. What does pay-out means? For securities and funds.
47. What are clearing members?
48. When does clearing happen?
49. When does settlement happen?
50. What are the front, middle and back offices?
51. What are the functions of front, middle and back offices?
52. What are the depositories?
53. How many types of depositories in India?
54. What are the DP participants?
55. What are the functions of DP participants?
56. What is custodian? And its role?
57. What is DMAT Account?
58. What is trading Account?
59. What is margin means?
60. What does initial margin means?
61. What does minimum margin means?
62. What does SPAN margin means?
63. What is collateral?
64. What is CFS?
65. What is haircut?
66. What does M2M margin?
67. What is VAR margin?
68. What is ELM-VAR margin?
69. What is MTM profit and loss and how it does compute?
70. What is BPL and how does it compute?
71. What is mutual fund?
72. What do you mean by regulatory?
73. What is ISIN?
74. What is an auction?
75. What is square off, how many types of square modes are there?
76. What is short selling, SLB means?
77. What are SEBI and Its functions?
78. What are the different sessions in Exchanges?
79. What is pre-open session?
80. What is closing session?
81. What is Post –closing session?
82. What are Institutional clients?
83. What are Non-Institutional clients?
84. Concept of commodity trading?
85. What is OMS?



Selenium Questions Part12: Selenium Grid

  1. What is Selenium Grid and when do we go for it?
  2. What are the advantages of Selenium Grid?
  3. What is a Hub in Selenium Grid?
  4. What is a Node in Selenium Grid?
  5. Explain how Selenium Grid works?
  6. Can we use Selenium Grid for performance testing?
  7. What are Selenium Grid Extras and the additional features does it add to Selenium Grid?
  8. Can’t we execute tests parallel without using Selenium Grid?
  9. How do you execute tests in Selenium Grid?
  10. Suppose in selenium grid, there are 4 nodes connected and the test execution started in grid paralleled. In middle of the execution one of the nodes got disconnected. What happens with the execution?
  11. Suppose in selenium grid, if you are doing parallel testing in 3 browsers. How many reports will your framework generate and how do you segregate each browser execution results?
  12. When we execute test cases in grid where results will be stored in node or hub?

Selenium Questions Part11: Selenium Framework Questions

1. What is a Framework?

Answer:  A set of guidelines like coding standards, test-data handling, object repository treatment etc. Which when followed during automation scripting produce beneficial outcomes like increase code re-usage, higher portability, reduced script maintenance cost etc. Mind you these are just guidelines and not rules; they are not mandatory and you can still script without following the guidelines. But you will miss out on the advantages of having a Framework.

2. What are the different types of Frameworks?

Answer:  Types of Automated Testing Frameworks

  • Linear Automation Framework - It's sometimes known as a linear scripting framework or a record and play back framework. It works like this: testers create and write test scripts sequentially, performing it individually for each individual test case, hence the record and play back.
  • Modular Based Testing Framework - Modular framework is like creation of small, independent scripts that represents modules, sections and functions of the application under test. Testers use Modular testing framework to divide an application into multiple modules and create test scripts individually.
  • Library Architecture Testing Framework - It divides the application-under-test into procedures and functions in its place of scripts. This framework requires the creation of library files that represent modules, sections, and functions of the application-under-test.
  • Data-Driven Framework - Data-driven is a test automation framework which stores test data in a table or spread spreadsheet format.
  • Keyword-Driven Framework - A keyword-driven framework is a table-driven testing or action word based testing. This is used to speed up automated testing by utilizing the keywords for a common set of actions.
  • Hybrid Testing Framework - Hybrid Driven Framework is a combination of both the Data-Driven and Keyword-Driven framework. ... Keywords are maintained in a separate Java class file and test data can be maintained either in a properties file/excel file

3. What is the principle difference between a Data-driven framework and a Keyword Driven Framework?

Answer: In data driven testing, we can run our tests on multiple data in multiple combinations with the help of parameterization. Here the data is treated as an input to the test script logic. Each data set can be treated as a separate test case.

In keyword driven testing, the keywords that are developed represent an action. A list of keywords maintained in sequence form a test case. Thus a keyword once developed can be used in multiple test scripts.

4. What are the advantages of Automation Framework?

Answer: Utilizing a framework for automated testing will increase a team’s test speed and efficiency, improve test accuracy, and will reduce test maintenance costs as well as lower risks. They are essential to an efficient automated testing process for a few key reasons: 

  • Improved test efficiency
  • Lower maintenance costs
  • Minimal manual intervention
  • Maximum test coverage
  • Re usability of code

5. What are the different components of your framework and explain each?

Answer: Please refer below article to understand about different component in a framework

https://www.automationtestinginsider.com/2020/02/selenium-data-driven-framework-with-pom.html

6. While explaining the framework, what are points which should be covered?

Answer: This question answered in detail on question#8

7. How do you decide a particular framework for a project?

Answer: To help determine which framework is right for your organization, ask yourself the following helpful questions:

  • Consider the application and the technology involved.
  • Think about testing requirements.
  • Determine license cost of the tool.
  • Evaluate the skill sets available within your organization.

8. Can you explain the Selenium Framework which you have used in your project?

Answer:  When we give any answer in the interview the one and only important thing we need to keep in mind is It should be brief and to the point so that interviewer should not lose interest from our answer.

So whenever we need to give answer about framework we can divide framework in terms of different components which we are using to build a structure which we called a framework and which we use in our company

We can start like mentioned below.

1. We are using Page Object with Page Factory framework with functional/structural implementation.

Make sure you know what functional/structural implementation in this framework.

2. We are using standardized maven project for build, execution & dependency management.

Make sure you know about a build tool like ant/maven

3. Language and IDE:  We are using JAVA/Ruby as our binding language and eclipse as IDE. We use java because it is known to most people when we started automation.

4. Action Driver - We also have library package to maintain common functions related to All action method/Selenium/waits/directory creations etc

5. We also have a base page class for common functions use by all pages – to load config.properties file and Web Driver initialization.

Make sure you know why we have Base Page class in page object

5. We have maintained a page class for every page in our application and a page test class to maintain test for that pages. E.g. Product listing page, Add to cart page, Payment page, Invoice generation page.

Make sure you know we maintain different page and all different annotations in page factory

Page Objects Package- com.mystore.pageobjects

Page Class – AddToCart.java

6. We have maintained separate package for page test e.g.

Test Package - com.mystore.testcases

Test Class – AddToCartTest.java

Note:  Maintaining different packages is always a good practice to follow.

7. Utility component - Extent Class, Log4j class, Listeners, Data Providers

Package Name: com.mystore.utility

8. For handling data driven cases we are passing data using xlsx file/xls file /csv file.

>> Make sure you know about libraries like openCSV,JXL/APACHE POI/Java Properties class

9. For ordering tests we are using testng framework.

Make sure you know how to use different annotations and run testng.xml using maven

10. We are using log4j library to maintain logging of our project. We are using all kinds of logging statements like INFO, DEBUG, and ERROR etc. We have maintained a separate class for it in com.mystore.utility package

>> Make sure you know this library usage in java, we can use log4j by mentioning properties of this framework in a xml file or a properties file and putting that file on build path.

11. We are using Extent Report for reporting purpose. It is a third party report and it is easily available at maven central repo.

We are using maven postman plugin / JAVA API to send generated extent reports as an attachment to client Distribution list.

>> Make sure you know about this plugin of maven or Java API

12. We check in our code into client repository using a version controlling tool git bash on windows system.

13. CI tool - We have integrated our project with CI tool i.e. Jenkins to run the build automatically.

Summary: - We should talk about all major components in our project like Logging, Emailing, Page Objects, Page Factory Annotations, TestNG, Exception Handling, Build tool, Version controlling tool, DataDriven usage etc.

10. How you build object repository in your project framework?

Answer: page object model using page factory

11. What is Test Driven Development (TDD) Framework?

Answer: Test-Driven Development is a testing methodology or a programming practice implemented from a developer’s perspective. In this technique, a QA engineer starts designing and writing test cases for every small functionality of an application. The purpose of TDD is to make the code clearer, simple and bug-free.

TDD instructs developers to write new code only if an automated test has failed. This avoids duplication of code. The full form of TDD is Test-driven development.

The simple concept of TDD is to write and correct the failed tests before writing new code (before development). This helps to avoid duplication of code as we write a small amount of code at a time in order to pass tests. (Tests are nothing but requirement conditions that we need to test to fulfill them).

TDD Cycle

Test-Driven development is a process of developing and running automated test before actual development of the application. Hence, TDD sometimes also called as Test First Development.

12. What is Behavior Driven Development (BDD) Framework?

Answer: Behavior -Driven Development (BDD) is a testing approach derived from the Test-Driven Development (TDD) methodology. In BDD, tests are mainly based on systems behavior. This approach defines various ways to develop a feature based on its behavior. In most cases, the Given-When-Then approach is used for writing test cases. Let’s take an example for better understanding:

  • Given the user has entered valid login credentials
  • When a user clicks on the login button
  • Then display the successful validation message

The simple language used in the scenarios helps even non-technical team members to understand what is going on in the software project. This helps and improves communication among technical and non-technical teams, managers, and stakeholders.

Behavior Driven Development (BDD) framework is a software development process that is an offshoot of Test Driven Development (TDD) framework.  BDD is an agile testing methodology. It is the process of development, based on test-driven development and domain-driven.

13. What are the main traits of a good Software Test Automation framework?

Answer: Below are some of the key parameters that a software tester needs to keep in mind, while developing a test automation framework.

  • Handle scripts and data separately.
  • Create libraries.
  • Follow coding standards.
  • Offer high extensibility.
  • Less maintenance
  • Script/Framework version control

Tips:

  • Proper knowledge of Programming language concept
  • Write page classes for all the pages
  • Test Classes may be differ based on the requirements
  • Write validations (Assertions) in the test class only
  • Write the user actions In Page class only
  • Use proper waiting mechanism in page class (user actions) only
  • Usage of proper Naming convention 
  • Always add the comments when you create new class
  • All test cases should be independent as possible

14. Where you have applied OOPS in Automation Framework?

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=v0Yz8mXQA18&list=PLsGOlyTzNH6dQREgTsqPy6C79wWyouEcu&index=10

15. How do you accommodate project specific method in your framework?

Answer: 1st go through all the manual test cases and identify the steps which are repeating. Note down such steps and make them as methods and write into ProjectSpecificLibrary.

16. Where you encounter synchronization in your project?

Answer:  Synchronization is a mechanism which involves two or more components working parallel with each other. Usually, in test automation, there will be two components such as application under test and the test automation tool. Both of them will have specified speeds and the test scripts should be written in a way such that both these components will work with same speed. This will help to avoid “Element Not Found” error which otherwise will consume more time to clear off.

https://www.automationtestinginsider.com/2020/02/waits-in-selenium-webdriver.html

17. Which Test Automation Framework you are using and why?

Answer: Please refer question#8

18. Mention the name of the Framework which you are using currently in your project, explain it in details along with its benefits?

Answer:  Please refer question#8

19. Mention the name of the Framework which you have hands on experience?

Answer:  Please refer question#8

20. Can you explain the Selenium framework which you have used in your project?

Answer: Please refer question#8

21. Where did you implement hashmap concept in framework

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=KAYzkFKlGaQ&list=PLsGOlyTzNH6dQREgTsqPy6C79wWyouEcu&index=9

Project github link: https://github.com/hverma22/MyProject.git

22. Why we are using constructor in framework

Answer: To initialize the page objects in page class

24. Where to use abstract class in framework

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=v0Yz8mXQA18&list=PLsGOlyTzNH6dQREgTsqPy6C79wWyouEcu&index=10

25. Which files can be used as data source for different frameworks?

Answer: Some of the file types of the dataset can be: Excel xml, text, csv, etc.

26. How can I read test data from Excel files?

Answer:  Please refer below YouTube video

https://www.youtube.com/watch?v=isEQPMuB4YU&list=PLsGOlyTzNH6dhM1NCjkbfMTXg-hXnjeqd

27. What is the difference between POI and JXL Jars?

Answer:  Difference between JXL and POI is that Java JXL does not support the Excel 2007+ ". xlsx" format; it only supports ". xls" format. Apache POI supports both with a common design.

28. What is Page Object Model (POM) and its advantages?

Answer: Page Object Model

Page Object Model is a design pattern to create Object Repository for web UI elements. Under this model, for each web page in the application, there should be corresponding page class. This Page class will find the Web Elements of that web page and also contains Page methods which perform operations on those Web Elements.

Advantages

  • Object Repository: You can create an Object Repository of the fields segmented page-wise. This as a result provides a Page Repository of the application as well. Each page will be defined as a java class.
  • Functional Encapsulation: All possible functionality or operations that can be performed on a page can be defined and contained within the same class created for each page. This allows for clear definition and scope of each page's functionality.
  • Low maintenance: Any User Interface changes can swiftly be implemented into the interface as well as class.
  • Programmer Friendly: Robust and more readable. The Object-oriented approach makes the framework programmer friendly.
  • Low Redundancy: Helps reduce duplication of code. If the architecture is correctly and sufficiently defined, the POM gets more done in less code.
  • Efficient & Scalable: Faster than other keyword-driven/data-driven approaches where Excel sheets are to be read/written.

29. What is Page Factory?

Answer: Page Factory is a class provided by Selenium WebDriver to support Page Object Design patterns. In Page Factory, testers use @FindBy annotation. The initElements method is used to initialize web elements. @FindBy: An annotation used in Page Factory to locate and declare web elements using different locators.

30. What is the difference between Page Object Model and Page Factory?

Answer:  Page Object Model (POM) and Page Factory have following differences:

A Page Object Model is a test design pattern which says organizes page objects as per pages in such a way that scripts and page objects can be differentiated easily. A Page Factory is one way of implementing PageObject Model which is inbuilt in selenium.

  • In POM, you define locators using ‘By’ while in Page Factory, you use FindBy annotation to define page objects.
  • Page Object Model is a design approach while PageFactory is a class which provides implementation of Page Object Model design approach.
  • POM is not optimal as it does not provide lazy initialization while Page Factory provides lazy initialization.
  • Plain POM will not help in StaleElementReferecneException while Page Factory takes care of this exception by relocating web element every time whenever it is used.
  • In plain page object model, you need to initialize every page object individually otherwise you will encounter NullPointerException while In PageFactory all page objects are initialized (Lazily) by using initElements() method.

31. What are the advantages of Page Object Model?

Answer: Covered in question#28

32. In POM how to pass value from 1 page to another page?

Answer: Passing another page object:

Try to initiate the page objects in your test and use it from there. To do that just don't return the DashboardPage object from the submit method.

33. Explain what is a data driven framework?

Answer: Data-driven is a test automation framework which stores test data in a table or spreadsheet format. This allows automation engineers to have a single test script which can execute tests for all the test data in the table.

Why Data Driven Testing?

Look at the following Example:

We want to test the login system with multiple input fields with 1000 different data sets.

To test this, you can take following different approaches:

Approach 1) Create 1000 scripts one for each data-set and runs each test separately one by one.

Approach 2) manually change the value in the test script and run it several times.

Approach 3) Import the data from the excel sheet. Fetch test data from excel rows one by one and execute the script.

In the given three scenarios first two are laborious and time-consuming. Therefore, it is ideal to follow the third approach. Thus, the third approach is nothing but a Data-Driven framework.

34. Explain what is a keyword driven framework?

Answer: In keyword driven testing, the keywords that are developed represent an action. A list of keywords maintained in sequence form a test case. Thus a keyword once developed can be used in multiple test scripts.

35. How can you prepare customized HTML report using TestNG in hybrid framework?

Answer: Please refer question#12 from below link

https://www.automationtestinginsider.com/2019/10/selenium-questions-part7-testng.html

36. How can you generate HTML report from your test scripts?

37. Write the code for Reading and Writing to Excel through Selenium?

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=isEQPMuB4YU&list=PLsGOlyTzNH6dhM1NCjkbfMTXg-hXnjeqd

38. How do you use Map Collections in your Selenium Project (Give some examples) ?

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=KAYzkFKlGaQ&list=PLsGOlyTzNH6dQREgTsqPy6C79wWyouEcu&index=9

39. How do you read and write into a PDF file?

40. What is the folder structure of your framework and explain each folder?

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=iFEoctz-wy4&list=PLsGOlyTzNH6dQREgTsqPy6C79wWyouEcu&index=1

41. What do you use for reporting in your Selenium Project?

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=eYVirg_ZuJk&list=PLsGOlyTzNH6dQREgTsqPy6C79wWyouEcu&index=7

42. What is a Data Provider and what is its return type?

Answer: Data provider returns a two-dimensional JAVA object to the test method and the test method, will invoke M times in a M*N type of object array. For example, if the DataProvider returns an array of 2*3 objects, the corresponding testcase will be invoked 2 times with 3 parameters each time.

43. How to create the reusable methods for reading the data from the Excel files?

Answer: Refer Complete excel library

44. How to create the reusable methods for reading the data from the XML files?

45. What is an interface and where you have used in your Framework?

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=v0Yz8mXQA18&list=PLsGOlyTzNH6dQREgTsqPy6C79wWyouEcu&index=10

46. Draw the architecture of a framework implementing Page Object Model and its uses?

Answer: Please refer below YouTube video

https://www.youtube.com/watch?v=iFEoctz-wy4&list=PLsGOlyTzNH6dQREgTsqPy6C79wWyouEcu&index=1

47. Why do we go for Page Object Model (POM) and what is its purpose?

Answer: POM is a design pattern which is commonly used in Selenium for Automating the Test Cases. The Page object is an object-oriented class which acts as an interface for the page of your Application under test. Page class contains web elements and methods to interact with web elements.

48. What have you done to improve the performance of selenium framework?

Or How to Make Selenium WebDriver Scripts Faster

Answer: There are multiple things that can improve the Selenium WebDriver scripts speed:

  • use fast selectors
  • use fewer locators
  • create atomic tests
  • dont test the same functionality twice
  • write good tests
  • use only explicit waits
  • use the chrome driver
  • use drivers for headless browsers
  • re-use the browser instance
  • run scripts in parallel
  • use HTTP parse libraries
  • pre-populate cookies
  • do not load images in the web page

49. We have heard about frameworks well it can be broadly classified into these TDD, BDD and ATDD frameworks .What’s the Difference?

Answer: Few, Differences between TDD BDD and ATDD

  • TDD is a development technique that focuses more on the implementation of a  feature.
  • BDD focuses on the behavioral aspect of the system rather unlike the TDD focuses on the implementation aspect of the system.
  • Acceptance Test-Driven Development is very similar to Behavioral-Driven Development. However, a key difference between them is: BDD focuses more on the behavior of the feature, whereas ATDD focuses on capturing the accurate requirements.

50. What is the difference between data driven and modular frameworks?

Answer: Modular: In modular frameworks, the application can be divided into different modules which can be tested independently. Data-Driven Framework: In data-driven frameworks, test data is separated from test scripts and stored in an external resource such as text file, excel spreadsheet, CSV file or database table.

Please refer below YouTube video: