0% found this document useful (0 votes)
15 views

Interview Things

Uploaded by

haliderdur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Interview Things

Uploaded by

haliderdur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Interview Things

1) What kind of testing are you doing ?

- Smoke
- Regression
- Functional
- Integration
- Positive – Negative testing
- Black-box
- Ad-hoc (random testing)

2) Are you doing automation or manual testing ?

- 60-70% I was doing automation, 30-40% manual testing, but I always help other
manual testers as a cross-functional team member.
- I have worked on UI testing, backend testing, and API testing.

3) What is Jenkins ?

- Jenkins is a continuous integration (CI/CD) tool.


- I’m using Jenkins for my smoke suite and regression suite.
- I’m scheduling my tests with Jenkins, Cucumber tags and Git.

4) What is Agile, do you have Agile experience ?

- I have experience with both waterfall and Agile environments.


- I prefer to work in AGILE teams, because communications, collaboration, team work
is really important. I worked with 2-3-4 weeks sprint AGILE teams.
- In my last company I was working with 3 weeks sprints.

5) What is Agile Scrum meetings ?

- We had daily stand up meetings, sprint grooming, sprint planning, sprint demo,
sprint retro meeting.

- Daily stand ups : everyday, 15 mins

- Planning : app ve yeni feature hakkinda bilgi aliyoruz. ( first day of sprint )

- Grooming : we are giving estimations for the tasks.


Herkes tahmini bitirme suresini veriyor, ( first day of the sprint )
- Demo : (end of the sprint), we are doing presentations to client, stakeholder,
business people involved.

- Retro : (end of the sprint), Kendi kendimize degerlendirme yapiyoruz.


What was good? How can we improve?

6) Your team members in your last project ?

- In my last team I was working with 2 testers, 6 developers, 1 scrum master, 1


business analyst.

7) Do you have offshore team experience ?

- Yes, I worked with offshore teams before, we had meeting on late nights or very
earlier in the morning. It is not a problem, I can work with offshore teams.

8) What is your Challenges ?

- Limited time for testing.


- My team member had to go to his country because of visa issue, and I had to take
care of his role at the same time for a while.but it was not a problem most important
part is our teams success.

9) What is Page Object Model ?

- Locatorlari koydugumuz yer/class (id, name, class, linktext, xpath, css…)


- Reusable
- Easy to organize
- Easy to maintain
- I am creating separate page object model classes for each pages.
- Constructor + PageFactory.initElements(); + @FindBy

10) What is Maven and pom.xml file ?

- Dependencies (maven)

11) What is TestNG ?

- (TDD)
- Annotations (@BeforeMethod, @BeforeTest, @Test, @AfterMethod, @AfterTest)
- Assertion (AssertTrue, AssertEquals, AssertFalse)
- TestNG.XML
12) What is JUnit ?

- (with Cucumber BDD)


- Annotations (@Before, @After, @Test)
- Assertion (AssertTrue, AssertFalse, AssertEquals)

13) How can you verify ?

- I’m using Assertions with JUnit.

14) What is Access modifiers ?

- public
- private
- protected
- default

15) What is OOP (Object-Oriented Programming) ?

- JAVA is an object-oriented programming language.


- We have 4 main OOP principles.

- Encapsulation – data hiding, making variables “private”. We can access to private


variables with getter & setter methods.
- Inheritance – it’s like parent – child relationship. We are using “extends” keyword.
Child class has all methods / variables from parent class.
- Abstraction – it’s hiding implementation, there is no method body. We’re using
“abstract” keyword. There are 2 types of abstraction: “abstract class” & “interface”
- Polymorphism

16) What is BDD ?

- Cucumber is BDD tool.


- I am using Cucumber with JUnit
- We are using GHERKIN language with BDD, it’s just like basic English (when, then,
and, given, scenario)
- I am writing scenarios with gherkin language.
- BDD is a bridge between technical and non-technical (business) people.

17) What is Cucumber ?

- Cucumber is BDD tool.


- Im using cucumber with JUnit.
- I’m using feature files, step definitions, runner class.
18) What is Cucumber components?

- Feature file : I’m writing scenarios (and scenario outline) with Gherkin.
- Step definitions : I m implementing feature file scenarios to java test class.
- Runner class : I m using Runner class to run my test suits.
- Hook class : I m using @Before and @After annotations and reusable methods.

19) What is JENKINS ?

- Jenkins is a continuous integration tool.


- I m using Jenkins to schedule and run my smoke and regression suits.
- I am checking Jenkins reports.

20) Can you explain your smoke and regression suite in your last project ?

- I had 12 tests in my smoke


- We had more than 500 in regression suit.

21) Do you have experience with GIT / GitHub ?

- I used Git and GitHub for version control and store my code.
- I’m using git commit, push and pull commends.

JAVA – Interview Review

22) JDK  JRE  JVM

- JDK (java development kit)


- JRE (java runtime environment)
- JVM (java virtual machine)

23) What is main method ?

- We need main method to run the java code.


- Main method is static because it can be called directly.
- Public static void main (String[] args) {}

24) What is Primitives ?

- Primitives are values / datas.


- We have 8 primitives
- Byte, short, int, double, char, float, long
25) What is Object and Class ?

- Class : is a template
- Object : comes from the class, object is an instance of the class.( object class’in
ogesidir.)

26) What is String and String methods ?

- String comes from java


- String methods:

toUpperCase()
toLowerCase()
length()
contains()
substring()
indexOf()

27) String vs StringBuffer vs StringBuilder ?

- String  immutable
- StringBuffer  mutable
- StringBuilder mutable

28) How many different ways to check conditions ?

- IF condition (if - else - else if)


- SWITCH statement

29) How many LOOPS we have?

- We have 4 loops
- For loop, while loop, do while loop, for-each loop

30) What is Constructor ?

- as

31) ACCESS Modifiers

- Public  protected  default  private

32) ACCESS Modifiers


- Public : everyone can see
- Protected : everyone in same package, also sub-classes in different package.
- Default: every class in same package.
- Private : only in class.

33) Final / finally / finalize ?

- Final :
if variable is final, it means its unchangeable
if method is final , we can not override
if class is final , we can not inherit
- Finally : keyword for try-catch block, it is working no matter what.
- Finalize : for garbage collector

34) What is static ?

- We can call directly without create an object


- Static methods / values belong to the class, does not depend to object
- Its shareable.
- Static can refer only static members.

35) What is static block ?

- Runs only once before anything .

36) What is OOP ?

- Encapsulation
- Inheritance
- Abstraction
- Polymorphism

37) ENCAPSULATION

- Data hiding
- Making variable private
- You can access private variables with getter / setter methods.

38) INHERITANCE

- Parent – child class relationship.


- Child class can use everything from parent class.
- We are using “extends” keyword
- Java supports only one inheritance
39) ABSTRACTION

- There are two types of abstraction, “abstract class” and “interface”


- Abstraction  hiding implementation (we don’t have method body)
- We are using “abstract” keyword.
- We can not create an object in abstract class and interface .
- Abstract class can contain both abstract and non-abstract methods.

40) INTERFACE

- For example WebDriver is an interface.


- For example LIST, SET, MAP are also interfaces.

41) POLYMORPHISM

- For example when we create a driver object from WebDriver interface or when we
create an ArrayList from List interface we are using polymorphism here.
- Concrete class implements all methods of reference class (parent)

- WebDriver driver = new ChromeDriver();


(reference type) (concrete class)

- List list1 = new ArrayList();


(reference) (concrete)

- There are two types of polymorphism:


static polymorphism.  overloading
dynamic polymorphism  overriding

42) OVERLOADING

- Same method name, different signature (parameters)


- For example: println() is an OVERLOADED method

println()
println(String x)  same method name, different signature, overloading
println(int x)  same method name, different signature, overloading
43) OVERRIDING

- Same method name, same signature, different body ( implementation )


- We need parent / child class (inheritance) relationship for overriding.
- Static methods cannot be overridden.

public void play(int num) {  same method name + same signature


print(“football”);  different body
}

Public void play(int num) {  same method name + same signature


print(“basketball);  different body
}

44) What is data structure in JAVA ?


- I’m storing data in array, arraylist…
- Array
- Collections (list, set)
- Map

45) What is ARRAY

- It is a collection of a data.
- We are storing multiple datas in one array.
- Array is Fixed Size
- Array cannot be resized / modified.
- Same data type (all elements are int or all string)

- String[] cities = new String[3];  fixed-size, only 3 fixed-values

cities[0] = New York;


cities[1]= Washington;
cities[2]= Chicago;

- int[] years = {1991, 1992, 1993};


46) What is ARRAYLIST

- ArrayList is a collection of Object types..


- Can be resized, it is NOT FIXED SIZE.
- ArrayList comes from List.

- List <String> cities = new ArrayList();

cities.add(“New York”);
cities.add(“Washington”);  we can add values, resizable
cities.remove(“New York”);  we can remove values, resizable

47) What is Collections ?

- Collection is an interface
- LIST and SET comes from Collection.
- List  ArrayList, LinkedList
- Set  HashSet, TreeSet

48) What is the differences between ARRAY and ARRAYLIST ?

- Arrays are not resizable and fixed size


- ArrayList are resizable.
- Array is static, ArrayList is dynamic.
- Array can hold primitives, ArrayList can hold objects.

49) What is the differences between LIST and SET ?


- List can hold duplicated values.
- Set can hold only unique values.

- List  ArrayList
- Set  HashSet

50) What is MAP ?


- Map is key + value combination
- Key must be unique, value can be duplicated
- <Key, Value>

- Map<String, Integer> ages = new HaspMap();


ages.put (“Selma”, 27);  key: Selma, value: 27
ages.put (“Fatih”, 28);  key: Fatih, value: 28

51) LIST vs SET vs MAP ?

- LIST  ordered / indexed / can contain duplicated values.


- SET  not ordered / not indexed / only unique values
- MAP  Key + value combination
<Key, value>  key is unique, value can be duplicated

52) What is Exceptions ?

- There are 2 types of exceptions ;

Checked  we need to handle it  with try-catch or throws


Un-checked (RunTime)

example:
- NoSuchElementException
- WebDriverException
- TimeOutException

53) How to handle exceptions ?

- Try – catch block


- We can handle with “throws” or “try-catch” block.

SELENIUM – Interview Review

54) What is SELENIUM ?

- Selenium is UI automation tool, I’m using Selenium with JAVA.

(advantages)
- Selenium is open source
- Selenium supports multiple browsers

(disadvantages)
- Selenium supports only web-based apps.
- Selenium does not support operation systems (windows, mac) apps.
- We can not test desktop applications using Selenium.
- Selenium cannot automate CAPTCHA.

55) Some basic Selenium methods / commends:

- getText()
- getTitle()
- sendKeys()
- sendKeys(“Selma” + Keys.ENTER)

56) How can you open browser with Selenium ?

- Launching browser:
WebDriver driver = new ChromeDriver();

- Open a specific webpage:


driver.get(“www.google.com”);

- Closing the browser:


driver.quit();
driver.close();

57) What is Locators ?

- We have 8 Locators
- id , name , className , Xpath , CSS , tagName , linkText , partialLinkText
- if I have id or name I’m using them, else I prefer to use XPath.

58) What is the differences between absolute XPath and Relative XPath ?

- Absolute XPath is starting with single slash (“ / ”)


- Relative XPath starts with double slash (“ // “ )
- I’m using Relative XPath because Absolute XPath is really breakable

59) XPath syntax (relative) ?

- //tagname[@attribute=’value’]

ex:
//input[@id=’selma’]
60) How can you go to second element with XPath ?

- (//input[@id=’fatih’])[2]

61) How do you handle dynamic elements ?

- I’m using relative XPath with some methods such as:


contains()
starts-with()
text()
OR
AND

//input[contains(@name, ‘sel’)]
//input[@id=’submit’ AND @name=’btnLogin’]

62) What is Implicit Wait vs Explicit Wait ?

- Implicit Wait  for all Elements


- For example, during the tests implicitWait waits 10 seconds to find the elements.
- If it finds the element before the given time, it will continue.
- If it doesn’t find, it throw NoSuchElement() exception and test will fail.

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS)

- Explicit Wait  for one specific Element


- It waits for specific condition / element until selenium find
- We are using WebDriverWait object.
- We can use visibilityOf(), elementToBeClicikable() methods.
- If it cannot find it throws timeOutException() or elementNOtClickable()

WebDriverWait wait = new WebDriverWait();


wait.until(ExpectedConditions.visibilityOf(element));

63) What are some common exceptions in Selenium ?

- NoSuchElementException
- ElementNotVisibleException
- TimeOutException
- WebDriverException

64) What is StaleElementException ?

- This is happening in two cases, if element is deleted or element is missing on DOM.


- If we are in different page , it can also happen.

solution:
- Sleep a little bit.  Thread.sleep(2000)
- Locate the element again.

65) How can you handle DROPDOWN ?

I’m using SELECT class with some methods:

Select dropdown = new Select();

SelectByVisibleText()
SelectByIndex()
SelectByValue()

66) How can you handle POP-UP’s (Alerts) ?

- I’m using ALERT class.


- Also I am using switchTo (), alert (), accept (), dismiss () methods

Alert alert = driver.switchTo().alert();

alert.accept()  accept alert/pop-up


alert.dismiss()  dismiss alert/pop-up

67) How can you handle iFrame ?

- I m using switchTo() and frame() methods.


- Also we can use defaultContent() method to go to main page.

driver.switchTo().frame(“…”);  go to iframe
driver.switchTo().defaultContent();  go to main page
68) How can you handle mouse actions ?

- I am using Action Class for mouse actions with methods.

- Action action = new Action (driver);

action.build();
.perform();
.doubleClick();
.drugAndDrop();
.clickAndHold();
.moveToElement();

69) How can you switch tabs ?

- I am using getWindowHandles() , switchTo() , window() methods

driver.switchTo().window(windowHandle);

70) How can you handle Radio Buttons / Checboxes ?

- I am using isSelected() method for radio buttons

isSelected()
isDisplayed()
isEnabled()

71) What is the differences between findElement() vs findElements() ?

- findElement()
 Returns the first most web element if there are multiple web elements found
with the same locator.
 It will only find one web element

- findElements()
 Returns a list of web elements
CUCUMBER (BDD) – Interview Review

72) TDD vs BDD ?

- TDD  Java , Selenium , TestNG


- BDD  Java , Selenium , Cucumber , JUnit

73) Why BDD (Cucumber) is popular ?

- Because of AGILE.

74) What is Cucumber ?

- Cucumber is a BDD testing tool.


- It is a bridge between technical (tester, developer) and non-technical (client,
business) people.
- Gherkin is a Cucumber language, is like a basic English.
- Everyone can understand al scenarios, tests easily.
- We are using Gherkin because everyone can understand in Agile environment.

75) What we are using with Cucumber?

- Feature files
- Step definitions
- Runner Class

76) What is Feature File?

- We are writing tests in Cucumber Feature files using Gherkin language.


- We are using some keywords like Given, When, Then, Scenario, Feature, Background
- We are using tags for tests like @smoke, @regression, @test

@regression
Feature: Amazon HomePage

Scenario: Search Tab


Given User is on Amazon HomePage
When User enters iPhone to searchbox
Then User should see all iPhones
77) What is Runner Class?

- We create Runner Class for to run the code.


- In Runner class , we are using some Annotations (@RunWith, @CucumberOptions)
- Our tests will be in feature files , we run tests from the runner class.

@RunWith(Cucumber.class)
@CucumberOptions(
features = “feature files”,
glue = "step definitions",
tags = ”@regression”,
plugin = ”reports”,
dryRun = “generate annotations for step definitions”)

public class AmazonRunner {

78) What is Runner class keywords ?

- Features : we are locating feature file locations.


- Glue : we are locating step definitions locations
- Tags : we put specific tags for scenarios to run.
- Plugin : for creating report file (HTML report, JSON report)
- dryRun : its showing you the missing part for the step definition.

79) What is Step Definitions ?

- Step Definition is Java implementation of feature file steps/scenarios.

80) What is Cucumber tags ?

- We put tags for scenarios in feature file  @regression : for scenario


- We put tag in runner class to run.  @regression: to run same scenario

81) What is Background in feature file ?

- It will run once before each scenario in feature file.


- It will run every time.
- Before any scenario background will run.
82) How can we build Cucumber testing framework ?

- We are using Maven , Java , Selenium , JUnit , Cucumber based on page object
model.

- Maven : build tool, we are adding dependencies. (pom.xml)


- Java : we are using java for automating test steps.
- Cucumber : the testing tool , we use for test scenarios. ( Gherkin )
- JUnit : for verifying tests using assertions.
- Selenium : UI automation tool for controlling browser.
- RestAssured : API automation library.

83) What is Scenario Outline?

- we can use Scenario outline for same scenario with multiple sets of data.
- We use “scenario outline” with “examples” table.
- Scenario icin outline hazirliyoruz , bosluklara datalari her seferinde tekrar otomatik
doldurup testi run ediyor.

Feature: Check account balance

@smoke
Scenario Outline: Manupulate Login Test With Data
Given <name> has a valid credit or debit card
And his/her account balance is <accountBalance>
When he/she insert the card
Then he/she should see account balance is <currentBalance>

Examples:

| name | accountBalance | currentBalance |


| value1 | value2 | value3 |
| value4 | value5 | value6 |

84) What is Cucumber – Hooks ?


- I create Hook class
- Hooks always run before or after each scenarios
- What ever we wanted to be worked before and after each scenarios we put them in
Hooks using @Before and @After Annotations.

85) How to run a specific Scenario from a feature file?

- we can run specific scenario from feature file by using tags.


@test, @selmaTest, @smoke, @regression

API (Web Services) – Interview Review

86) What is the differences between SOAP and REST ?

- SOAP supports only XML


- REST supports XML , JSON , TEXT

- REST is new and faster version of API.


- I have experience with both XML and JSON.

87) What API tools are you using ?

- SoapUI  manuel api testing tool. ( SOAP )


- Postman  manuel api testing tool. ( REST )
- Rest-Assured  java library for api automation.

88) What is API Methods (HTTP Methods / CRUD Operations)

- POST  if I want to send new data I can use post .


- GET  for receiving all datas.
- PUT  it is updating the excisting data ( not creating new )
- DELETE  deleting the data.

89) What is the difference between POST and PUT ?

- POST is creating a brand new data, PUT is updating excisting datas.

90) What is HTTP STATUS CODES ?

- 200  success ,ok


- 400  client error , our error
- 500  server error, its not our fault.

- 404  not found

91) How can you validate JSON response body ?

- I am checking http status codes.


- I can use Assertions with Hamcrest Matchers , JUnit or TestNG.
Check later:

Acceptance criteria
User story
Velocity
Priority / Severity
SDLC
STLC
Defect life cycle
What to do when you find a defect
Test plan
Test case
Requirement Traceability Matrix (RTM)

RestAssured – Java API automation


Serialization/De-serialization
SQL

You might also like