41. Did you find any test scenarios that not to be automated in your project using selenium?
Yes, we found some test scenarios. Functionalities that require more user interaction and functionalities that require dynamic test data submission.


42. How to execute multiple Java programs at a time?
We can execute multiple Java programs using .XML file in TestNG framework.


43. How to conduct Parallel test executions?
We can conduct parallel test execution using Selenium GRID.


44. What defect management / test management tool you used in your project?
We are using JIRA test management tool in our project with Selenium.


45. How you communicated with development team to resolve the issues?
In our project,  we communicated directly with the development team.
Project management allocated Developers to Testers.


46. What is debugging and when debugging is required?
Answer: Locating and isolating errors through step by step execution. Only for some test cases, debugging is required.
It is required whenever code or test-case is not showing any errors, and not providing correct output.


47. Did you involve in Selenium Test environment Setup?
Answer: Yes, I was involved in selenium environmental set up in my current project.
As per my project, we selected Java for programming and writing test scripts,
Selenium WebDriver for creating test cases.
We used TestNG framework for grouping test cases, executing test batches & generating detailed test reports.
We have used MAVEN as the build management tool.
a. Downloaded Eclipse IDE and extracted.
b. Downloaded Java software – JDK and installed.
c. Set Environmental paths for Java.
d. Downloaded Selenium WebDriver Jar files and added to our java project.


48. What Is the difference between , Assert (SoftAssert, HardAssert) and Verify In Selenium?
Answer:
When an “Assert” command fails, the test execution will be aborted. It is called Hard Assert. So when the Assertion fails, all the test steps after that line of code are skipped. We can use try catch block to handle this.

To overcome this we use Soft Assert in TestNG. Soft Assert does not throw an exception when an assert fails and would continue with the next step after the assert statement. If there is any exception and you want to throw it then you need to use assertAll() method as a last statement in the @Test and test suite again continue with next @Test as it is. We need to create an object to use Soft Assert which is not needed in Hard Assert.
SoftAssert soft = new SoftAssert(); //Object of SoftAssert().
soft.assertTrue(False);
soft.assertAll(); //At the last to fail the case if required.

When a Verify command fails, the test will continue executing and logging the failure. There wont be any halt in the test execution even though the verify condition is true or false.


49. What is the difference between findElement() and findElements() in Selenium Webdriver?
Answer
:
findElement () will return only single WebElement (found first) and if that element is not located or we use some wrong selector then it will throw NoSuchElement exception. Return type is always a WebElement.
Ex: WebElement ele = driver.findElement(By.id(“xyzid”));

findElements() will return List of WebElements (all satisfying the locator value passed)– for this we need to give locator in such a way that it can find multiple elements and will return you list of web elements then using List we can iterate and perform our operation. Return type is always a List<WebElement>.
Ex: List<WebElement> list = driver.findElements(By.tagName(“a”));
Syso(list.size();


50. What is POM (Page Object Model) in Selenium?
Answer
:
(1) Page Object Model is a design pattern to create Object Repository for web UI elements.
(2) Under this model, for each web page in the application, there should be corresponding page class.
(3) This Page class will find the WebElements of that web page and also contains Page methods which perform operations on those WebElements.
(4) Name of these methods should be given as per the task they are performing, i.e., if a loader is waiting for the payment gateway to appear, POM method name can be waitForPaymentScreenDisplay().


One response to “Selenium Interview Questions for Freshers and Experienced”

Leave a Reply