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

Java Question Practice

To post a request in API automation, you use a library like RestAssured to build the request and send it to the API endpoint. To get the response, you use the response object returned and make assertions. For authentication, you add authentication parameters like tokens to the request header. Page object model is a design pattern used in UI automation to organize test code.

Uploaded by

ANIL KUMAR SAMAL
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Java Question Practice

To post a request in API automation, you use a library like RestAssured to build the request and send it to the API endpoint. To get the response, you use the response object returned and make assertions. For authentication, you add authentication parameters like tokens to the request header. Page object model is a design pattern used in UI automation to organize test code.

Uploaded by

ANIL KUMAR SAMAL
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

What is the Difference between String,string buffer and string builder?

Ans:
string-String is sequence of character.It is denoted as double quoutes("").String
is a immutable.
String buffer: String Builder:
String buffer are mutable string builder are
mutable.
It is synchronized and thread safe It is not a thread
safe and non synchronized.
That's why string
builder is faster than string buffer.
String concatination operator internally uses both string buffer and builder.

2.What is string constant/literal pool?


Ans: String constant pool is a special type of memory location,it store the string
object or it is a place in the heap memory which is stores the string literal
values.
What is static block in java?
Ans: Static block in java is mainly used to initialized the static data member.
A static block is executed before the main method at the time of class loading.

TestNg:

Q: What are the common TestNg assertion?


Ans:Assert.assertEquals(String actual,String Expected)
Assert.assertEquals(String actual.string expected,string message)
Assert.assertEquals(boolean actual,boolean expected)
Assert.assertTrue(<condition(t/f)>)

2-Q: What is the uses of @Factory annotaion?


Ans: The @Factory Annotaion is useful when if we want to execute the multiple test
case in a single class.It is mainly use for dynamic execution of test cases.
3-Q What is the difference between @Dataprovider and @Factory annotation?
@Dataprovider:
Ans: It is annotation used in testng to excute the test method in multiple number
of times based on the data provided by the data provider.
@Factory:
It is annotation used by the TestNg to excute the test method present in the same
test class using difft Instance of the respective class.

Good Knowledge of Software Development Life Cycle and Software Test Life Cycle.
Knowledge of Various SDLC Models, Test Levels, Test Types, and Test design
Techniques. Knowledge of All phases of the Software Test Process.

Acurious company question:


How do you post a request in API automation? How do you get its response? How do
you perform authentication in API automation? what is page object model?

You might also like