-
Open a browser
# start an instance of firefox with selenium-webdriver $browser_type = 'firefox' $host = 'http://localhost:4444/wd/hub'
$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Configuration status="WARN"> | |
| <Properties> | |
| <Property name="basePath">./logs</Property> | |
| </Properties> | |
| <Appenders> |
| import com.aventstack.extentreports.ExtentReports; | |
| import com.aventstack.extentreports.ExtentTest; | |
| import com.aventstack.extentreports.Status; | |
| import com.aventstack.extentreports.reporter.ExtentSparkReporter; | |
| import com.aventstack.extentreports.reporter.configuration.Theme; | |
| import org.testng.ITestContext; | |
| import org.testng.ITestListener; | |
| import org.testng.ITestResult; | |
| import java.text.SimpleDateFormat; |
| <!-- https://mvnrepository.com/artifact/org.reflections/reflections --> | |
| <dependency> | |
| <groupId>org.reflections</groupId> | |
| <artifactId>reflections</artifactId> | |
| <version>0.9.12</version> | |
| </dependency> |
| try { | |
| Class.forName(driver); | |
| Connection con = DriverManager.getConnection(url + db, user, pass); | |
| Statement stmt = con.createStatement(); | |
| ResultSet rs = stmt.executeQuery(query); | |
| ResultSetMetaData rsmd = rs.getMetaData(); | |
| List<String> columns = new ArrayList<String>(rsmd.getColumnCount()); | |
| for(int i = 1; i <= rsmd.getColumnCount(); i++){ | |
| columns.add(rsmd.getColumnName(i)); | |
| } |
| ############################## | |
| ## Java | |
| ############################## | |
| .mtj.tmp/ | |
| *.class | |
| *.jar | |
| *.war | |
| *.ear | |
| *.nar | |
| hs_err_pid* |
| import java.io.File; | |
| import java.net.URL; | |
| import org.openqa.selenium.OutputType; | |
| import org.openqa.selenium.TakesScreenshot; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.firefox.FirefoxDriver; | |
| import org.openqa.selenium.firefox.FirefoxProfile; | |
| import org.openqa.selenium.remote.DesiredCapabilities; | |
| import org.openqa.selenium.remote.RemoteWebDriver; |
| import java.io.File; | |
| import java.net.URL; | |
| import org.openqa.selenium.OutputType; | |
| import org.openqa.selenium.TakesScreenshot; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.chrome.ChromeOptions; | |
| import org.openqa.selenium.remote.DesiredCapabilities; | |
| import org.openqa.selenium.remote.RemoteWebDriver; |
| import java.io.File; | |
| import java.net.URL; | |
| import org.openqa.selenium.OutputType; | |
| import org.openqa.selenium.TakesScreenshot; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.WebElement; | |
| import org.openqa.selenium.html5.Location; | |
| import org.openqa.selenium.remote.DesiredCapabilities; |
| import java.io.File; | |
| import java.net.URL; | |
| import org.openqa.selenium.By; | |
| import org.openqa.selenium.JavascriptExecutor; | |
| import org.openqa.selenium.OutputType; | |
| import org.openqa.selenium.TakesScreenshot; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.WebElement; | |
| import org.openqa.selenium.remote.DesiredCapabilities; |