Importing java doc into eclipse

Importing java doc into eclipse

  • Right click on your project->properties->java build path

  • Go to the libraries tab-> Select and expand Selenium server jar File

  • Select Javadoc Location->Click on Edit

  • Now Paste the URL and remove “index.html” part.

  • Validate and Click on OK. Apply->OK

Program-41

How To Get X Y Coordinates Of Element

Program-42

Zoom In And Zoom Out Page

DesiredCapabilities Class

The desired capability is a series of key/value pairs that stores the browser properties like browsername, browser version, the path of the browser driver in the system, etc. to determine the behaviour of the browser at run time.

It is used to configure the driver instance of Selenium WebDriver. We can configure all driver instance like FirefoxDriver, ChromeDriver, InternetExplorerDriver using desired capabilities.

Program-43

Set Proxy Settings in Selenium WebDriver (Manual Proxy Configuration)

Program-44

Handling Cookies in Webdriver

Program-45

Highlight elements in Selenium Webdriver during script execution

How to generate log files How to configure log4j

What is Log File?

The log file is a just simple file (Any file whose extension is .log will be considered), which keeps track of the record or event or info when any event happens or any software run. This whole process is known as logging.

Why is it required in Selenium?

We can create a log file for our simple script also so we can track or debug our script easily if anything goes wrong in the script. For example, if our script is failing at some point then we can track back what went wrong.

What is log4J Log4j is free open source tool given by Apache foundation for creating log files It helps us to generate a log file in various output target.

How to create log files in selenium

Step 1- Download log4j jar file (https://logging.apache.org/log4j/1.2/download.html)

Step 2- Add log4j to your current project Select your project > Right click > Click on build path> Click Configure build path> Go to library section > Add external jar file > select the log4j > click on Ok

Step 3- Open notepad and copy the below code and save the file as log4j.properties.

Properties file examples

Java properties file is used to store project configuration data or settings

Reading a properties fil

Write to properties file

Read write Excel File

Reading an excel file

Reading an excel file is also very simple if we divide this in steps.

1. Create workbook instance from excel sheet

2. Get to the desired sheet

3. Increment row number

4. iterate over all cells in a row

5. repeat step 3 and 4 until all data is read

Read Excel file which have formula cells

Last updated