Posts

How to TakeScreenshot Using Selenium 4

  mvn clean test    Dependencies : < version > 1.0-SNAPSHOT </ version > < dependencies > <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> < dependency > < groupId > org.seleniumhq.selenium </ groupId > < artifactId > selenium-java </ artifactId > < version > 4.4.0 </ version > </ dependency > <!-- https://mvnrepository.com/artifact/org.testng/testng --> < dependency > < groupId > org.testng </ groupId > < artifactId > testng </ artifactId > < version > 7.6.1 </ version > < scope > test </ scope > </ dependency > <!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager --> < dependency > < groupId > io.github.bonigarcia </ groupId > < artifactId > ...

ParseJSON

<dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20090211</version> </dependency> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> </dependency>  public class test { String n; public String readJSONData(String keyword) throws IOException, ParseException { JSONParser parser = new JSONParser(); JSONArray jsonArr = (JSONArray)parser.parse(resp); for(Object obj : jsonArr){ JSONObject jo = (JSONObject)obj; n = (String)jo.get(keyword); } return n; } public static void main(String[] args) throws IOException, ParseException { test e = new test(); String a = e.readJSONData("blog URL");     System.out.println(a); } }

AI900

Image
 Artificial Intelligence : AI is the ability of a machine to   replicate Natural Intelligence    ( NI is came from born like human,animal ,insects have ) :)    1. Prediction: What can happen in the future ( blind ) 2. Forecasting : Predicting future on the basis of Data ( previous events. Anomaly Detection

Any one can become expert on XPATH

Image
 Below are the XPATH axes:

File Reader Utility

// File Read Write on Note Txt File // File file = new File ( filePath ); FileReader fr = new FileReader ( file ); BufferedReader br = new BufferedReader ( fr ); while ( br . readLine () != null ){ String data = br . readLine (); System . out . println ( data ); } br . close (); File file = new File(filePath); FileWriter fw = new FileWriter(file); BufferedWriter bw = new BufferedWriter(fw); bw.writeLine("Hello"); bw.newLine(); bw.writeLine("World"); bw.close(); // File Write Feature // FileInputStream fis = new FileInputStream(filePath); Workbook wb = WorkbookFactory.create(fis); Sheet sh = wb.getSheet("SheetName); Row rw = sh.getRow(1); Cell cl = rw.getCell(1); String data = cl.getStringCellValue(); int data = cl.getNumCellValue(); // File Write Feature // FileInputStream fis = new FileInputSteam(filePath); Workbook wb = WorkbookFactory.create(fis); Sheet sh = wb.getSheet("Sheetname"); Row rw...

Cucumber Framework

 Choose Maven FW: Step 1 - Create a new maven project Step 2 - Add maven dependencies   Cucumber Java | Cucumber JUnit | JUnit | Selenium Java Step 3 - Create a folder Features under src/test/resources Step 4 - Under features folder create a new feature file login.feature Step 5 - Download cucumber plugin from Eclipse Marketplace Step 6 - Create feature file and add contents Feature Scenario Steps Scenario Outline Example Tags Comments Step 7 - Try to run the feature file Step 8 - Add Step Definitions / Glue Code under src/test/java package Step 9 - Create a Runner class Step 10 - Create Add Cucumber Options for generating reports    HTML | JSON | JUNIT/XML    Step 11 - Run and verify results HOOKS: Cucumber supports hooks, which are blocks of code that run before or after each scenario.: @Before and @After package utilities; import cucumber . api . java . After; import cucumber . api . java . Before; public class Hooks { @Before public void beforeScena...

Manual Testing Questions

1.a cyclic machine having reparative cycle ..what will be the approach for testing 2.what is regression and impact testing 3.what is STLC 4.what is API 5.what tools used for api testing 6.diff b/w http and HTTPS 7.diff b/w Authorization and authentication 8.what is json 9.diff b/w overloading and overriding 10.diff b/w load , volume and stress testing 11.what is object 12.what is system testing 13.can we create object of abstract class 14.can we create object in interface 15.diff b/w abract and interface 16.base class of exception 17.what is base class of collection 18.what is data hidding 19.diff b/w hashmap and treemap 20.what you will check while doing api testing