Tuesday, August 25, 2020

Database SQL

 Professional Programming Language

MY SQL

About:

        Most popular open source relational SQL Database management system.

        Used for developing various web-based software applications.

MYSQL Installation:



Create Database:

        Use NewDB; //database name

        create table example(//table name) (username varchar(50), password varchar(50));



OUTPUT:


Show the table data's:

        use newdb;

        desc example;  //description


OUTPUT:


Insert data into tables:

        use newdb;

        INSERT into example values('xxxxx' , 'xxx123');

        INSERT into example values('yyyy' , 'yyy123');

OUTPUT:


Selections in database:

1)Particular column select:

        use newdb;

        select username from example;


OUTPUT:


2)Particular field selection:

        use newdb;

        select * from example where username = 'xxxx';


OUTPUT:


3) Select particular fields:

        use newdb;

        select * from employee where empsalary >= 15000;

        select * from employee where empsalary >= 20000;

OUTPUT:


Delete table in database:

        use newdb;

        delete from employee where empname = "xxyy";


OUTPUT:


Update data into tables:

        use newdb;

        update employee set empname = 'zzzz' where empid =  4;


OUTPUT:


Insert Particular Field:

        use newdb;

        insert into employee (empname, empid, empdesignation, empsalary) values ('xyxy', 5, 'executive', 10000));


OUTPUT:


Ascending order:

        use newdb;

        select * from employee order by empname asc;













R Programming Tutorials

 

R Programming

 

Data Types

Vector

a <- c('orange','white',"black")

print(a)

output

[1] "orange" "white"  "black" 

 

Lists

a <- list(c(12,33),'sabari')

print(a)

Output

[[1]]
[1] 12 33
 
[[2]]
[1] "sabari"
 

Matrix

M = matrix( c('a','a','b'), nrow = 1, ncol = 3, byrow = TRUE)

print(M)

Output

   [,1] [,2] [,3]
[1,] "a"  "a"  "b" 

 

Arrays

a <- array(c('sabari','nathan'),dim = c(2,2))

print(a)

Output

  [,1]     [,2]    
[1,] "sabari" "sabari"
[2,] "nathan" "nathan"

 

Factors

a <- c('sabari','sabari','nathan')

 

b <- factor(a)

 

print(b)

Output

[1] sabari sabari nathan
Levels: nathan sabari

 

DataFrames

a <-        data.frame(

   gender = c("Male", "Male","Female"),

   height = c(152, 171.5, 165)

)

print(a)

Output

  gender height
1   Male  152.0
2   Male  171.5
3 Female  165.0

 

 

 

Variable Declarations

#equal opeartor

a = c(0,1,2,3)          

print(a)

#left

a <- c(0,1,2,3)          

print(a)

#right

 c(0,1,2,3) -> a

print(a)

 

Output

[1] 0 1 2 3
[1] 0 1 2 3
[1] 0 1 2 3

 

If-else

a <- c("sabari","nathan")

 

if("sabari" %in% a) {

   print("found")

} else {

   print("not found")

}

Output

[1] "found"

 

Switch-Case

Example

x <- switch(

   2,

   "sabari",

   "nathan"

)

print(x)

Output

[1] "nathan"

 

For Loop

Syntax

for (value in vector) {
   statements
}

 

Example

a <- LETTERS[15:17]

for ( i in a) {

   print(i)

}

Output

[1] "O"
[1] "P"
[1] "Q"

 

While Loop

 

Syntax

while (test_expression) {
   statement
}

 

Example

a <- c("sabari","nathan","mca")

count <- 1

 

while (count <3) {

   print(a)

   count = count + 1

}

Output

[1] "sabari" "nathan" "mca"   
[1] "sabari" "nathan" "mca"   

 

Functions

1.Built-in Functions(Examples)

Sum

print(sum(50:70))

Output

1260

Mean

print(mean(15:30))

Output

22.5

 

Max

print(max(15,30))

Output

30
 
2.User Defined Functions

 

Example

a <- function(a) {

  print(a)

}

 

a("sabari")

Output

Sabari

Strings

a <- 'Sabarinathan'

print(a)

b <- "MCA"

print(b)

Output

[1] "Sabarinathan"
[1] "MCA"

 

toupper() & tolower()  Functions in String

a <- toupper('Sabarinathan')

print(a)

 

b <- tolower("MCA")

print(b)

Output

[1] "SABARINATHAN"
[1] "mca"

 

Substring

a <- substring('Sabarinathan',3,7)

print(a)

Output

[1] "barin"

 

Data-Interfaces

1.R with CSV Files


Save the file sabari.csv

data <- read.csv("sabari.csv")

print(data)

 

Output

 

      id,   name,    salary,   start_date,     dept
1      1    sabari     8000    2020-01-01      IT
2      2    nathan     6000    2020-02-23      Sales
3      3    saranya    9000    2020-03-15      IT
4      4    nithi      4000    2020-03-15      Sales

 

Analysis

 

data <- read.csv("sabari.csv")

print(ncol(data))

print(nrow(data))

 

Output

5

3

Maximum Salary

data <- read.csv("sabari.csv")

a <- max(data$salary)

print(a)

Output

9000

 

Get the details of the person with max salary

data <- read.csv("sabari.csv")

b<- subset(data, salary == max(salary))

print(b)


Output

 

id,   name,    salary,   start_date,     dept
3      3    saranya    9000    2020-03-15      IT

 

 

Get the details of the person with Working in Sales Department

data <- read.csv("sabari.csv")

b<- subset(data, dept ==”Sales”)

print(b)

 

Output

      id,   name,    salary,   start_date,     dept
2      2    nathan     6000    2020-02-23      Sales
4      4    nithi      4000    2020-03-15      Sales

 

Get the persons in Sales  department  & salary is greater than 5000

data <- read.csv("sabari.csv")

b    <- subset(data, salary > 5000 & dept == "Sales")

print(b)

 

Output

      id,   name,    salary,   start_date,     dept
2      2    nathan     6000    2020-02-23      Sales

 

Writing into a CSV File

data <- read.csv("sabari.csv")

b<- subset(data, salary == max(salary))

write.csv(b,"output.csv")

c <- read.csv("output.csv")

print(c)

Output

id,   name,    salary,   start_date,     dept
3      3    saranya    9000    2020-03-15      IT

 

Excel Format

Sabari.xlsx


Step 1
 
install.packages("xlsx")

 

Step 2

data <- read.xlsx("sabari.xlsx", sheetIndex = 1)

print(data)

 

 

 

Output

 

      id,   name,    salary,   start_date,     dept
1      1    sabari     8000    2020-01-01      IT
2      2    nathan     6000    2020-02-23      Sales
3      3    saranya    9000    2020-03-15      IT
4      4    nithi      4000    2020-03-15      Sales

 

XML Format

Step 1

install.packages("XML")

 

<RECORDS>

   <EMPLOYEE>

      <ID>1</ID>

      <NAME>Sabari</NAME>

      <SALARY>8000</SALARY>

      <STARTDATE>1/1/2020</STARTDATE>

      <DEPT>IT</DEPT>

   </EMPLOYEE>

               

   <EMPLOYEE>

      <ID>2</ID>

      <NAME>nathan</NAME>

      <SALARY>6000</SALARY>

      <STARTDATE>23/2/2020</STARTDATE>

      <DEPT>Sales</DEPT>

   </EMPLOYEE>

  

   <EMPLOYEE>

      <ID>3</ID>

      <NAME>saranya</NAME>

      <SALARY>9000</SALARY>

      <STARTDATE>15/03/2020</STARTDATE>

      <DEPT>IT</DEPT>

   </EMPLOYEE>

  

   <EMPLOYEE>

      <ID>4</ID>

      <NAME>nithi</NAME>

      <SALARY>4000</SALARY>

      <STARTDATE>15/03/2020</STARTDATE>

      <DEPT>Sales</DEPT>

   </EMPLOYEE>

  

               

</RECORDS>

Step2

library("XML")

library("methods")

a <- xmlParse(file = "sabari.xml")

print(result)

 

Output

1

sabari

8000      

1/1/2020             

IT

2

nathan 

6000      

23/2/2020           

Sales

3

saranya               

9000      

15/03/2020        

IT

4

nithi      

4000      

15/03/2020        

Sales

 

JSON

Step1

install.packages("rjson")

 

sabari.json

{

    "Sheet1": [

        {

            "id": "1",

            "name": "sabari",

            "salary": "8000",

            "start_date": "1/1/20",

            "dept": "IT"

        },

        {

            "id": "2",

            "name": "nathan",

            "salary": "6000",

            "start_date": "23/2/2020",

            "dept": "Sales"

        },

        {

            "id": "3",

            "name": "saranya",

            "salary": "9000",

            "start_date": "15/03/2020",

            "dept": "IT"

        },

        {

            "id": "4",

            "name": "nithi",

            "salary": "4000",

            "start_date": "15/03/2020",

            "dept": "Sales"

        }

    ]

}

Example

library("rjson")

a <- fromJSON(file = "sabari.json")

print(a)

Output

 

$ID
[1] "1"   "2"   "3"   "4"   
$Name
[1] "Sabari"     "nathan"      "saranya" "nithi"     
$Salary
[1] "8000"  "6000"  "9000"    "4000"    
$StartDate

[1] " 1/1/2020"   " 23/2/2020"  " 15/03/2020" " 15/03/2020

$Dept
[1] "IT"  "Sales " "IT"   "IT”
 
Database with R

 

Step 1

install.packages("RMySQL")

 

Example

con = dbConnect(MySQL(), user = 'root', password = '', dbname = 'sabari',

   host = 'localhost')

 dbListTables(mysqlconnection)

Output

[1] "t"

 

 

Example

result = dbSendQuery(mysqlconnection, "select * from t")

a = fetch(result, n = 1)

print(a)

Output

        id,   name,    salary,   start_date,     dept
1      1    sabari     8000    2020-01-01      IT

 

 

R charts & Graphs

 

Pie-Charts

 

x <- c(80,90,70)

labels <- c("trichy", "chennai", "madurai")

png(file = "D://city.png")

pie(x,labels)

dev.off()

Output


 

Bar Charts

a<- c(10,11,20,30)

png(file = "D://city.png")

barplot(a)

dev.off()

 

Output







Histogram

v <-  c(20,30,25,72,89,90)

png(file = "D://city.png")

hist(v,xlab = "title",col = "green",border = "yellow")

dev.off()

output

 


Line Graph

v <-  c(20,30,25,72,89,90)

png(file = "D://city.png")

plot(v,type = "o")

dev.off()

Output


 R Statitics

1.Mean

x <- c(12,7,3)

a <-  mean(x)

print(a)

Output

[1] 7.333333

2.Median

x <- c(12,7,3)

a <-  median(x)

print(a)

Output

[1] 7

3.Linear Regression

Formula

y = ax + b

 

 

x <- c(10,20,30,25,90)

y <- c(93,42,42,12,3)

a <- lm(y~x)

print(a)

Output

 

 Call:

lm(formula = y ~ x)

 

Coefficients:

(Intercept)            x

      65.70        -0.78

 

Logistic Regression

Formula

y = 1/(1+e^-(a+b1x1+b2x2+b3x3+...))

 

a <- mtcars[,c("am","cyl")]

 

print(head(a))

Output

                          am cyl

Mazda RX4          1   6

Mazda RX4 Wag      1   6

Datsun 710         1   4

Hornet 4 Drive     0   6

Hornet Sportabout  0   8

Valiant            0   6

Normal Distribution

x <- seq(-20,1, by = .2)

y <- dnorm(x, mean = 1, sd = .2)

png(file = "D://city.png")

plot(x,y)

dev.off()

Output

 


 

pnorm

x <- seq(-20,1, by = .2)

y <- pnorm(x, mean = 1, sd = .2)

png(file = "D://city.png")

plot(x,y)

dev.off()

Output



Binomial Distribution

dbinom()

x <- seq(-20,1, by = .2)

y <- dbinom(x,50,.2)

png(file = "D://city.png")

plot(x,y)

dev.off()

Output

 



 

pbinom

x <- pbinom(20,30,0.5)

 

print(x)

output

[1] 0.978613

 

Decision Tree

install.packages("party")

 

library(party)

a <- readingSkills[c(1:105),]

png(file = "D://city.png")

b <- ctree(

  nativeSpeaker ~ age + shoeSize + score,

  data = a)

plot(b)

dev.off()

Output

 


Chi Square Test

library("MASS")

car.data <- data.frame(Cars93$AirBags, Cars93$Type)

car.data = table(Cars93$AirBags, Cars93$Type)

print(chisq.test(car.data))

Output

        Pearson's Chi-squared test

 

data:  car.data

X-squared = 33.001, df = 10, p-value = 0.0002723

 

Random Forest

install.packages("randomForest)

 

library(party)

library(randomForest)

a <- randomForest(nativeSpeaker ~ age + shoeSize + score,

           data = readingSkills)

print(a)

Time Series

rainfall <- c(90,12,33,22,11,66,88,99)

rainfall.timeseries <- ts(rainfall,start = c(2012,1),frequency = 12)

print(rainfall.timeseries)

png(file = "D://city.png")

plot(rainfall.timeseries)

dev.off()

 

Output

 



Monday, August 24, 2020

selenium webdriver tutorials

  

First Selenium Program

 

1.eclipse download

 

2.File->New ->Java Project Ã Projectname Ã Finish

3.selenium software download for java

https://www.selenium.dev/downloads/

 


 

 4.go to eclipse project right click the library folder

 


 

5.build path-àconfig build path


6.Add external jars (selenium library files add)


 

7.Apply and close

8.coding type

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("https://www.google.com");

       }

 

}

  

2.Locators Check

 

Name  Locator

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("https://www.google.com");

        driver.findElement(By.name("q")).sendKeys("tech");

        driver.findElement(By.name("btnK")).submit();

       }

 

}

 

 

Id Locator

 

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("https://www.facebook.com");

        driver.findElement(By.id("email")).sendKeys("tech");

       }

 

}

 

Xpath Locator

 

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("https://www.facebook.com");

        driver.findElement(By.xpath("//*[@id=’email’]")).sendKeys("tech");

       }

 

}


 

Link Text

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("https://www.facebook.com");

        driver.findElement(By.linkText("Forgotten account?")).click();

      

       }

 

}

 

Partial Link Text

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("https://www.facebook.com");

        driver.findElement(By.partialLinkText("Forgotten")).click();

      

       }

 

}

 

CssSelector

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("https://www.facebook.com");

        driver.findElement(By.cssSelector("#u_0_m")).sendKeys("hai");

      

       }

 

}

 

Check Box and Radio Button

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("http://demo.guru99.com/test/radio.html");

        driver.findElement(By.id("vfb-7-1")).click();

        driver.findElement(By.id("vfb-6-0")).click();

       

      

       }

 

}

 

DropDown

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.support.ui.Select;

 

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("http://demo.guru99.com/test/newtours/register.php");

        Select s = new Select(driver.findElement(By.name("country")));

        s.selectByVisibleText("INDIA");

      

       }

 

}

 

Webtable

Html file

 

<html>

<body>

<table border=”1”>

<tbody>

<tr>

<td>

First

</td>

<td>

Second

</td>

</tr>

</tbody>

</table>

 


 

Code

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.support.ui.Select;

 

public class s {

 

       public static void main(String[] args) {

              // TODO Auto-generated method stub

 

              System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

        driver.get("file:///C:/Users/ADMIN/Desktop/webtable.html");

      String adriver.findElement(By.xpath("/html/body/table/tbody/tr/td[2]")).getText();

      System.out.println(a);

       }

 

}

 

 

Installing TestNG in Eclipse

Go to Help Install new Software

 


 

 

Step 2

Paste the link http://dl.bintray.com/testng-team/testng-eclipse-release/


 

Click add button install testing

 

First TestNG project

 

Step 1

File->New ->other->TestNG->TestNG class


 

Click next

 


Create the testing project click finish

Right click the project folderàbuild path-àconfigurebuild path-àadd Library


Add TestNG library

 

 

Program

package p1;

 

import org.testng.annotations.Test;

import org.openqa.selenium.*;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.Assert;

import org.testng.annotations.*;

 

public class testngexample {

  @Test

  public void f() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

              WebDriver driver = new ChromeDriver();

      driver.get("https://www.google.com");

 

        

  }

}

 

Run


 

Getting html report

 

1.Right click the project folder

2.Click refresh

3.test-output folder(click index.html) get the html report

 

 

Annotation using TestNG

package p1;

 

import org.testng.annotations.Test;

import org.testng.annotations.BeforeTest;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.AfterTest;

 

public class NewTest {

 

              WebDriver driver ;

 

       @Test

  public void f() {

             

              driver= new ChromeDriver();

                 driver.get("https://www.google.com");

  }

  @BeforeTest

  public void beforeTest() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

             

  }

 

  @AfterTest

  public void afterTest() {

         driver.close();

  }

 

}

 

TestPrioirty

 

package p1;

 

import org.testng.annotations.Test;

import org.testng.annotations.BeforeTest;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.AfterTest;

 

public class NewTest {

 

              WebDriver driver ;

 

        @Test(priority = 1)

 

  public void f() {

             

              driver= new ChromeDriver();

                 driver.get("https://www.google.com");

  }

    @Test(priority = 0)

 

  public void beforeTest() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

             

  }

 

    @Test(priority = 2)

 

  public void afterTest() {

         driver.close();

  }

 

}

 

MultiSessions

 

 

package p1;

 

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.Test;

 

public class NewTest123 {

      

 

  @Test

  public void f() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

         WebDriver drivernew ChromeDriver();

                 driver.get("https://www.google.com");

  }

 

  @Test

  public void f1() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

         WebDriver drivernew ChromeDriver();

                 driver.get("https://www.facebook.com");

  }

 

 

}

Now create TestNG.xml


 

 


 

TestNG.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">

<suite name="Suite">

  <test thread-count="5" name="Test">

    <classes>

      <class name="p1.NewTest123"/>

      <class name="p1.example"/>

    </classes>

  </test> <!-- Test -->

</suite> <!-- Suite -->

 

 

 

Run the program

 

 


 

 

Multiple Test Suites

 

Package 1(package p1)

package p1;

 

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.Test;

 

public class NewTest123 {

      

 

  @Test

  public void f() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

         WebDriver drivernew ChromeDriver();

                 driver.get("https://www.google.com");

  }

 

 

 

}

 

 

Package 2(package p1)

package p2;

 

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.Test;

 

public class NewTest {

  @Test

  public void f() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

         WebDriver drivernew ChromeDriver();

                 driver.get("https://www.facebook.com");

  }

}

 

TestNG.xml

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">

<suite name="Suite">

  <test thread-count="5" name="Test">

    <classes>

      <class name="p1.NewTest123"/>

      <class name="p2.NewTest"/>

    </classes>

  </test> <!-- Test -->

</suite> <!-- Suite -->

 

TestNG Report Generation

 

Emailable-report.html

 


 



 

2.index.html

 


 


 

3.Report Class

 

Example

 

package p2;

 

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.Reporter;

import org.testng.annotations.Test;

 

public class NewTest {

  @Test

  public void f() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

         Reporter.log("the browser open");

 

         WebDriver drivernew ChromeDriver();

         Reporter.log("the browser type");

                 driver.get("https://www.facebook.com");

  }

}

 

Run the TestNG.xml file and refresh the folder

Open the emailable.html

 


 

Then we get the output

 

Take ScreenShot

Add commons-io-2.7.jar file to build path then

 

program

 

package p2;

 

import java.io.File;

 

import org.openqa.selenium.OutputType;

import org.openqa.selenium.TakesScreenshot;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.Reporter;

import org.testng.annotations.Test;

 

public class NewTest {

  @Test

  public void f() {

         System.setProperty("webdriver.chrome.driver","D:\\chromedriver.exe");

        

 

         WebDriver drivernew ChromeDriver();

      

                 driver.get("https://www.facebook.com");

                

                 TakesScreenshot scrShot =((TakesScreenshot)driver);

           File src=scrShot.getScreenshotAs(OutputType.FILE);

           File DestFile=new File("D://");

           FileUtils.copyFile(srcDestFile);

  }

}

 

 

 

 

 

Python Technical Interview Questions

 1)first non repeating character Malayalam y programming p str = "MalayalaM" a = '\0' for c in str:     if str.index(c) ==...