Check Selenium Interviewquestions from 1 to 10 below:
Check Selenium-SDET-UIAutomation Questions set 21 to 30:
Check Selenium-SDET-UIAutomation Questions set 41-50:
Q&A Set 41-50
Below is the list of most important attributes for TestNG annotations, in terms of day to day work and interview preparation
- Description: The description for this method.
If we are writing test script to validate 200 status code for /users get method then below is the description:
@Test(description="Validate 200 status code for /users GET API")
- Enabled: Whether methods on this class/method are enabled.
@Test(description="B_Users:Validate 200 status code for /users GET API", enabled=false)
As mentioned above, if we mark a test case enabled=false, then this test case will be skipped while execution.
- alwaysRun: If set to true, this test method will always be run even if it depends on a method that failed.
Ans: @Test(description="Validate 200 status code for /users GET API",alwaysRun=true)
- HOW to Rerun failed test cases of your automation suite using Listeners?
Ans: Click Here For Answer with code
- priority: The priority for this test method. Lower priorities will be scheduled first.
Ans: @Test(description="B_Users:Validate 200 status code for /users GET API", priority=1)
- What is the default priority in testng?
Ans: Based on ASCII value
- Can priority be negative or zero value?
Yes
- groups: The list of groups this class/method belongs to?
@Test(description="Verify email for User with id=2",groups= {"SomkeSuite","RegressionSuite"})
@Test(description="Verify status code for GET method-users/2 as 200",groups="SmokeSuite")
- Explain some of the Advanced TestNG annotations?
- Execute test cases from class payment?//payment is class name
<suite name="API Automation Smoke Suite">
<test name="Automation Test Cases">
<classes>
<class name="<nameofthepackage>.payment"/>
</classes>
</test>
</suite>
- Execute multiple classes from a package using testng xml suite?
<suite name="API Automation Smoke Suite">
<test name="Automation Test Cases">
<classes>
<class name="apiautomationeleven.test"/>
<class name="apiautomationeleven.registration"/>
<class name="apiautomationeleven.payment"/>
</classes>
</test>
</suite>
- Explain testNG annotation in sequence with real time scenario?example of @After@Before in TestNG?selenium interview qus/testng
- Execute all classes from a pckage using testng.xml suite?
<suite name="API Automation Smoke Suite">
<test name="Automation Test Cases">
<packages>
<package name="apiAutomationeleven" />
</packages>
</test>
</suite>
- How to run automation suites with groups?
<suite name="API Automation Smoke Suite">
<test name="Automation Test Cases">
<groups>
<run>
<exclude name="brokenTests" />
<include name="SmokeSuite" />
</run>
</groups>
</test>
</suite>
- How to use dependsOnGroups?
@Test(description="B_Users:Validate 200 status code for /users GET API",dependsOnGroups="Auth_OAUTH")
How to run test automation TestNG suite with gradle from jenkins job? Jenkins Integration with Gradle and TestNG.xml suite?Run TestNG suite with Gradle?
Ans: Click Here For Answer With Screenshot
- How you can specify your group dependencies in the testng.xml file. You use the <dependencies> tag to achieve this
<suite name="API Automation Smoke Suite">
<test name="Automation Test Cases">
<dependencies>
<group name="B_User" depends-on="Auth_Oauth" />
</dependencies>
</test>
</suite>
- How to use @Parameters in TestNG?
@Parameters({ "first-name" })
@Test
public void testSingleString(String firstName) {
System.out.println("Invoked testString " + firstName);
assert "Cedric".equals(firstName);
}
Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session
Entire course content can be found below: COURSE CONTENTCheck below link for question and answers with code:
- Check below link for question SET-01&02:
Top API Interview Question 1-10To check API related topics and interview tips check below and keep reading:Most Asked API Question For SDET
Want to learn more? ...Check below link for more interview question:
API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign
Java Related Interview Question Set
https://automationreinvented.blogspot.com/search/label/Java
GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT
Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
Thanks for sharing
ReplyDeletePython Online Training
Superb! Thanks for sharing.
ReplyDeleteVery good set of question & answers. Hope help students as well as the professionals for entry level.
ReplyDelete