What is Thanksgiving?

What is Thanksgiving?

Thanksgiving is a national holiday of USA, Canada etc. In USA, it is celebrated on 4th Thursday of November. This day is to give thanks for the blessing of the harvest. Modern Thanksgiving has been changed a lot. Everyone are curious about the Thanksgiving deals 🙂 and it has been well celebrated as a holiday. Most of the organization gives holidays on 4th Thursday & Friday of November making it a long weekend. One can look for Thanksgiving recipes, deals, restaurants to make the holidays more enjoyable.

What is DevOps?

What is DevOps?

DevOps is the latest Development Methodology where Dev team and Operations team are collaborated for better productivity , Improving the time to market of the product releases etc.

DevOps uses lots of tool like Git for Version controlling , Jenkins for Integrating multiple DevOps tools, helps on better communications between Developers, Testers, Operations team etc. Selenium is another tool used as part of DevOps which is a test automation and Jenkins controls and manages Selenium execution.

Puppet is another DevOps tool used for configuration management. Configuration script will be stored in puppet server and puppet agents on various VMs or target machines will be communicating puppet master. There are build management tools like Maven will be part of DevOps. Nagios is another DevOps tool which monitors systems, servers, infrastructures to make sure the deployed applications are running on production servers without any issues.

For testing specific requirements, Jenkins will help to send notification to Tester when a build is available for testing. Jenkins will trigger the selenium scripts and after execution, the results will be send out to target users including developers, management teams etc.

 

How to use JMeter for login authentication?

How to use JMeter for login authentication?

Regular Expression Extractor is used to handle this situation. Following steps may be used,

  1. First find out the GET request where the authentication required & POST request that posts the credential to login
  2. The response from the GET request should have tokens which needs to be be extracted and sent as a parameter in the POST request.
  3. Add a Regular Expression Extractor to store these tokens and include the tokens as parameter in the POST request

What is polymorphism in java with example

What is polymorphism in java with example

polymorphism means one object can take multiple forms. lets explain this using a method poly() in java class.

steps:

  1. create a package polymorphismPkg in eclipse
  2. create a class polymorphismClass  in eclipse
  3. now write below code in the class polymorphismClass  

package polymorphismPkg;

public class polymorphismClass {

public static void main(String[] args) {

polymorphismClass obj1 = new polymorphismClass();

obj1.poly(1, 2);
obj1.poly(1, 2, 3);
obj1.poly(1, 22.11);

}

public static void poly(int a, int b)

{
System.out.println(“this is first method for polymorphism”);
}

public static void poly(int n, int b, int c)

{
System.out.println(“this is like first method but number of argument is different in signature “);

}

public static void poly(int n, double b)

{
System.out.println(“this is like first method but argument order is different in the signature “);

}

}

 

 

 

What is Inheritance in Java with example

What is Inheritance in Java with example

One class in Java can get the methods and properties from other class – this helps reducing the coding efforts , increase code reusability and maintainability.

e.g. 

public class classB extends classB {

}

in the above Java code, classB class gets the methods and properties from classA class.

steps,

  1. create a meaningful project and a package in eclipse
  2. create 2 classes classA and classB under the package (Codes are below)

Code for classA class as below:

package inheritancePkg;

public class classA {

public void A()

{

System.out.println(“this is from father class”);
}

}

 

Code for classB class as below:

package inheritancePkg;

public class classB extends classA // extends classA is inheritance from classA class to classB

// so we are able to write obj1.add() from father.

{
public static void main(String[] args)
{

classB obj1 = new classB();
obj1.A();
obj1.B();

}

public void B()

{
System.out.println(“this is from son class “);

}

}

 

Top 5 sql interview questions and answers

Top 5 sql interview questions and answers

What is DDL, DML, DCL, TCL in SQL ?

DDL refers to Data Definition language. DDL is used to create/modify the structure of Database. e.g. CREATE, ALTER, DROP statement..

DML refers to Data Manipulation language. DML is used to retrieve, modify, delete, insert and update data in database. e.g. SELECT, UPDATE, INSERT statement

DCL refers to Data Control Language. DCL is used to create roles, permissions, and control access to database. e.g. GRANT, REVOKE statement.

TCL refers to Transactional Control Language. TCL is used to manage different transactions occurring within a database. e.g COMMIT, ROLLBACK statement

What is the difference between UNION vs UNION ALL?

          UNION and UNION ALL are used for merging two tables which has similar structure.

the difference between UNION and UNION ALL is that the UNION removes the duplicates while merging tables but UNION ALL do not and retain all duplicates.

UNION is slower in performance  as it has additional task of removing duplicates which causes more time in  execution.

What is the difference between query and subquery?

A Query is a code written to fetch information from the database where as subquery is a query within another query.  Basically subquery is an inner query. SubQuery is designed to executed first. The result of subquery is passed on to the main query which then process using the subquery output.

What is a stored procedure?

Stored Procedure is a function having several SQL statements. Stored procedure can be executed to process all SQL statements in it.

What is the difference between WHERE clause and HAVING clause?

Both WHERE and HAVING are used for filtering out records based conditions. WHERE clause can only be applied for static non-aggregated column whereas HAVING for aggregated columns.
SELECT * FROM Cricketbat WHERE batlenght > 2 feet
SELECT COUNT(Cricketbat)
FROM Bat
GROUP BY Team
HAVING COUNT(Cricketbat) > 2 feet;

What is DELETE and TRUNCATE commands?

DELETE command is used to remove selected rows from a table. A WHERE clause can be used to specify the rows to be deleted

 

What is difference between select and select distinct

Top 5 Salesforce Interview questions

Top 5 Salesforce Interview questions

1. What is object in salesforce?

Objects are database tables used to store specific data. There are two types of objects. 1. Standard objects 2. Custom objects.

2. What are different types of relationship in salesforce?

There are two different types of relationship in salesforce.
1. Master detail relationship
2. Lookup relationship

3. What is a trigger in salesforce ?

A Trigger is a code that is executed before or after a record is inserted or updated.

4. How many reports can be added to salesforce dashboard ?

20

5. What is validation rule ?

While creating or modifying a record, based on certain conditions validation rule helps to display error message.

6. What are escalation rules in sales force?

Escalation rules can be created on sales force case object and based on priority escalation emails can be sent.

Jenkins reset user password

Jenkins reset user password :

First stop the Jenkins service if you are already running jenkins

Go to the folder where jenkin’s config.xml file is stored (generally C:\jenkins\.jenkins\config.xml)

Open config.xml file using notepad++ or any text editor

Search for <useSecurity>true</useSecurity> and change that to <useSecurity>false</useSecurity>, Save the file.

re-start Jenkins service (using Java -jar jenkins.war in commandline)

You should not be seeing login prompt but directly accessing jenkins home page when you type localhost:8080 in browser.

To run Jenkins locally click here

How to run selenium tests in jenkins

How to run selenium tests in Jenkins

Jenkins configuration:

To run selenium scripts in Jenkins, Jenkins needs to started.

To make Jenkins server start, please use the following command in the Jenkins folder of your machine when Jenkins.war file is downloaded from internet…

  1. “java -jar jenkins.war” in DOS / command prompt mode.
  2. Then you need to bring the browser up and type “localhost:8080” to see jenkins web UI ready.
  3. Then navigate to Jenkins >> Manage Jenkins and click on “Configure system”
  4. Then scroll down to see the “JDK installations” section in the pag
  5. There you enter “JAVA_HOME” for “JDK name” field.
  6. Provide the Java-JDK file folder path for “JAVA_HOME” field.

Note:  Java-JDK file folder path is usually “C:\Program files\Java\JDK….”

Note: Disable “Install Automatically” check box else it will update with new Java versions and your selenium program might get conflicts

Selenium script development:

  1. create a package and class in Eclipse
  2. and then create a small test script – like print some message based on UI or Browser title name etc
  3. you could create a TestNG project
  4. Then TestNG.xml file will be created in Eclipse

Note: to get the XML folder path in project home directory, you could go to Eclipse project and right click to see properties.

Note: you also need to put all the jar files required for selenium testing under the lib folder(you may need to create”lib” folder)

Just to test your TestNG scripts are working, you can navigate to Project home directly (XML located) through DOS/Command prompt and then type as below:

Note: before that you need to set class path as bin directory of Project home folder. Command : “set classpath=C:\Selenium\project\bin;” as an example for binary file

Note1: similarly lib files, Command : “set classpath=C:\Selenium\project\lib\*” as an example

or command: set classpath=C:\Selenium\project\bin;C:\Selenium\project\lib\*;

Then execute testng.xml file through command prompt

command : java org.testng.TestNG testng.xml

Batch file creation for Jenkin execution

Create a batch file using notepad – steps

  1. Type the below contents in Notepad without quotes.

‘ java -cp bi;lib/* org.testng.TestNG testng.xml ‘

2) save the notepad as “runSelenium.bat” which will create a bat file. Place it in project home directory.

Jenkins job creation:

  1. Open Jenkins, then click on “New item”
  2. Enter item name as “JenkinSeleniumTest”
  3. Select “Freestyle project” , click Ok
  4. Then click on “Advance” button under the “Advance projects options”
  5. Then select “Use custom workspace”, then give the project home directory path in “Directory” field.
  6. Then “Add build setup” under “Build” and select “Execute Windows batch Command”
  7. Then type “runSelenium.bat” in the command field, click apply and save it.
  8. Then in the “JenkinSeleniumTest”, then click on “Build Now” which will call the batch file and then Selenium script internally.
  9. Verify the “Console output” in “JenkinSeleniumTest” which will show the Selenium execution results.