Skip to main content

Posts

Showing posts with the label Selenium

TestNG MCQ

Question :What is TestNG? A programming language A test automation framework A browser An operating system Correct Answer :  A test automation framework   Question :Which file is used to configure TestNG settings? testng.properties testng.xml testng.cfg testng.settings Correct Answer :  testng.xml   Question :How do you define a test method in TestNG? public void testMethod()` public void testMethod()` with `@Test` annotation public void testMethod()` with `@startTest` annotation `@TestMethod` Correct Answer :  public void testMethod()` with `@Test` annotation   Question :What is the purpose of the `@Test` annotation in TestNG? It marks a method as a test method It defines the test data It specifies the test priority It handles test dependencies Correct Answer :  It marks a method as a test method   Question :How do you group test methods in TestNG? Using the `@Group` annotation Using the `@Test` annotation Using the `@Group` annotation with the g...

TestNG Questions

Question:  TestNG Annotations Answer: @Test @BeforeMethod @AfterMethod @BeforeTest @AfterTest @BeforeClass @AfterClass @Test(enabled = false) @Test(enabled = true) @Test(priority=2) @Test(priority=5,dependsOnMethods={"method1","method2"}) @Test(dependsOnMethods = {"method1"}, alwaysRun=true) @Test(groups = { "Group1", "Group2" }) @Parameters({"testparameter1", "testparameter2"}) @Listeners(packagename.ListenerClassName.class) @Test (dataProvider = "getUserIDandPassword") @Test (description = "Open Facebook Login Page", timeOut=35000) @Test (invocationCount = 3, invocationTimeOut = 20000) @Test (invocationCount = 3, skipFailedInvocations = true) @Test (invocationCount = 3) @Test (invocationCount = 7, threadPoolSize = 2) Question:  Order of TestNG annotations Answer:  Order of TestNG annotations is as below : - @BeforeSuite @BeforeTest @BeforeClass @BeforeMethod @Test @AfterMethod @AfterClass @After...

Selenium Question

Question: What is Selenium? Answer: Selenium is a widely-used open-source automation testing framework primarily used for automating web applications. It provides a suite of tools that supports different aspects of test automation, including Selenium WebDriver , Selenium IDE , and Selenium Grid . Question: Explain the difference between Selenium WebDriver and Selenium IDE. Answer: Selenium WebDriver: It is a powerful automation tool used for automating web applications by directly interacting with the browser. WebDriver provides a programming interface to create and execute automation scripts in various programming languages. Selenium IDE: It is a record and playback tool used for creating automation scripts without writing any code. Selenium IDE allows users to record interactions with the browser and play them back as automated tests. Question: Explain Selenium Architecture. Answer: Selenium architecture consists of several important components. Seleni...