Selenium JAVA packages required for building the automation scripts
Sno
|
Package
Name
|
Purpose
|
Example
|
1
|
import org.openqa.selenium.firefox.FirefoxDriver;
|
To invoke firefox driver
|
|
2
|
import org.openqa.selenium.chrome.ChromeDriver;
|
To invoke chrome driver
|
|
3
|
import org.openqa.selenium.ie.InternetExplorerDriver;
|
To invoke IE driver
|
|
4
|
import org.openqa.selenium.support.ui.Select;
|
To manage the drop down box and list box. Invoke select class and
methods.
|
|
5
|
import org.openqa.selenium.interactions.Actions;
|
To manage keyboard and mouse operation. And invoke the actions class.
|
|
6
|
import org.openqa.selenium.*;
|
To manage Webelements, Alerts and Exceptions.
|
|
7
|
import java.util.concurrent.TimeUnit;
|
To manage implicit wait fucntions
|
|
8
|
import org.openqa.selenium.By;
|
To manage the findelement (By) method.
|
|
9
|
import org.testng.annotations.AfterTest
|
required for Test NG annotation - @AfterTest
|
|
10
|
import org.testng.annotations.BeforeTest;
|
required for Test NG annotation - @BeforeTest
|
|
11
|
org.testng.annotations.Test
|
required for Test NG annotation - @Test
|
|
12
|
import org.testng.annotations.AfterMethod
|
required for Test NG annotation - @AfterMethod
|
|
13
|
import org.testng.annotations.BeforeMethod;
|
required for Test NG annotation - @BeforeMethod
|
|
14
|
import org.openqa.selenium.Alert;
|
required to manage alerts
|
|
15
|
import org.openqa.selenium.TakesScreenshot;
|
Required for Screenshot
|
|
16
|
import org.openqa.selenium.OutputType;
|
Required for define outputtype in taking screenshot
|
|
17
|
import java.util.Properties;
|
Required for manage property files.
|
|
18
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
|
Required for to use the excel(.xlsx) functions.
|
|
19
|
import java.io.File;
import java.io.FileInputStream;
|
Required for manage file operations( txt files,csv files)
|
|
20
|
import java.io.IOException;
|
Required for manage the exceptions.
|
|
21
|
import java.util.List;
|
Required for list.
|
|
22
|
import org.apache.commons.io.FileUtils;
|
Reuired for copyfile. Ex:FileUtils.copyFile
|
|
23
|
import java.util.*;
import java.text.*;
|
Required for Date and Dateformat.
|
|
No comments:
Post a Comment