Author Archive
Example: public class CharacterUtils { private static char[] SOURCE_CHARACTERS = { ‘À’, ‘Á’, ‘Â’, ‘Ã’, ‘È’, ‘É’, ‘Ê’, ‘Ì’, ‘Í’, ‘Ò’, ‘Ó’, ‘Ô’, ‘Õ’, ‘Ù’, ‘Ú’, ‘Ý’, ‘à’, ‘á’, ‘â’, ‘ã’, ‘è’, ‘é’, ‘ê’, ‘ì’, ‘í’, ‘ò’, ‘ó’, ‘ô’, ‘õ’, ‘ù’, ‘ú’, ‘ý’, ‘Ă’, ‘ă’,…
Code: console.time(‘timerName’); //your javascript code console.timeEnd(‘timerName’); Example: console.time(‘timerName’); console.log(“heelo”); console.timeEnd(‘timerName’);
try { Date date = new Date(); Calendar cal = Calendar.getInstance(); cal.set(2017, 04, 08); int startYear = cal.get(Calendar.YEAR); int startMonth = cal.get(Calendar.MONTH); int startDay = cal.get(Calendar.DAY_OF_MONTH); System.out.println(“date year ” + startYear); System.out.println(“date month ” + startMonth); System.out.println(“date day ” + startDay); cal.setTime(date); int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_MONTH); System.out.println(“date…
Letter Date or Time Component Presentation Examples G Era designator Text AD y Year Year 1996; 96 Y Week year Year 2009; 09 M Month in year Month July; Jul; 07 w Week in year Number 27 W Week in month Number 2 D Day in year Number 189 d Day in month Number 10…
ProcessBuilder builder = new ProcessBuilder(“cmd.exe”, “/c”, “adb kill-server && adb start-server && adb devices”); builder.redirectErrorStream(true); Process p = builder.start();
import java.awt.image.BufferedImage; import java.io.File; import java.net.URL; WebElement imageEl = driver.findElement(By.xpath(“//img[@alt=’image’]”)); String imageElURL= imageEl .getAttribute(“src”); URL imageURL = new URL(imageElURL); BufferedImage saveImage = ImageIO.read(imageURL); ImageIO.write(saveImage, “png”, new File(“D:” + File.separator + “image.png”));
public static void main(String[] args) { TestListenerAdapter testListenerAdapter = new TestListenerAdapter(); TestNG testng = new TestNG(); testng.setTestClasses(new Class[] { test.class }); testng.addListener(testListenerAdapter); testng.run(); }
package com.automation; import …; @Listeners({com.automation.listenner.Local.class}) public class testClass{ AppiumDriver driver = null; @BeforeMethod public void beforeMethod() { } @DataProvider public Object[][] inputDatas() { Object[][] inputDatas = null; String csvFile = “C:” + File.separator + “file.csv”; try { List<String> lines = Files.readAllLines(new File(csvFile).toPath()); inputDatas = new Object[lines.size()][10]; String[] datas = new String[10]; String line =…
import com.automation.Example; @Listeners({com.automation.listenner.LocalSuiteListener.class, com.automation.listenner.LocalReportListener.class}) public class testClass{
Example: public class CharacterUtils { private static char[] SOURCE_CHARACTERS = { ‘À’, ‘Á’, ‘Â’, ‘Ã’, ‘È’, ‘É’, ‘Ê’, ‘Ì’, ‘Í’, ‘Ò’, ‘Ó’, ‘Ô’, ‘Õ’, ‘Ù’, ‘Ú’, ‘Ý’, ‘à’, ‘á’, ‘â’, ‘ã’, ‘è’, ‘é’, ‘ê’, ‘ì’, ‘í’, ‘ò’, ‘ó’, ‘ô’, ‘õ’, ‘ù’, ‘ú’, ‘ý’, ‘Ă’, ‘ă’,…
Code: console.time(‘timerName’); //your javascript code console.timeEnd(‘timerName’); Example: console.time(‘timerName’); console.log(“heelo”); console.timeEnd(‘timerName’);
try { Date date = new Date(); Calendar cal = Calendar.getInstance(); cal.set(2017, 04, 08); int startYear = cal.get(Calendar.YEAR); int startMonth = cal.get(Calendar.MONTH); int startDay = cal.get(Calendar.DAY_OF_MONTH); System.out.println(“date year ” + startYear); System.out.println(“date month ” + startMonth); System.out.println(“date day ” + startDay); cal.setTime(date); int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_MONTH); System.out.println(“date…
Letter Date or Time Component Presentation Examples G Era designator Text AD y Year Year 1996; 96 Y Week year Year 2009; 09 M Month in year Month July; Jul; 07 w Week in year Number 27 W Week in month Number 2 D Day in year Number 189 d Day in month Number 10…
ProcessBuilder builder = new ProcessBuilder(“cmd.exe”, “/c”, “adb kill-server && adb start-server && adb devices”); builder.redirectErrorStream(true); Process p = builder.start();
import java.awt.image.BufferedImage; import java.io.File; import java.net.URL; WebElement imageEl = driver.findElement(By.xpath(“//img[@alt=’image’]”)); String imageElURL= imageEl .getAttribute(“src”); URL imageURL = new URL(imageElURL); BufferedImage saveImage = ImageIO.read(imageURL); ImageIO.write(saveImage, “png”, new File(“D:” + File.separator + “image.png”));
public static void main(String[] args) { TestListenerAdapter testListenerAdapter = new TestListenerAdapter(); TestNG testng = new TestNG(); testng.setTestClasses(new Class[] { test.class }); testng.addListener(testListenerAdapter); testng.run(); }
package com.automation; import …; @Listeners({com.automation.listenner.Local.class}) public class testClass{ AppiumDriver driver = null; @BeforeMethod public void beforeMethod() { } @DataProvider public Object[][] inputDatas() { Object[][] inputDatas = null; String csvFile = “C:” + File.separator + “file.csv”; try { List<String> lines = Files.readAllLines(new File(csvFile).toPath()); inputDatas = new Object[lines.size()][10]; String[] datas = new String[10]; String line =…
import com.automation.Example; @Listeners({com.automation.listenner.LocalSuiteListener.class, com.automation.listenner.LocalReportListener.class}) public class testClass{