IBS Software Services
Divine HR Associates Interview Questions and Answers
Q1. How to validate that the URL loaded is correct or not?
To validate the correct URL loaded, check the current URL in the browser.
Get the current URL from the browser using driver.getCurrentUrl() method in Selenium.
Compare the current URL with the expected URL to validate correctness.
Use assertions or conditional statements to confirm if the URL is correct.
Consider handling any redirects or dynamic URLs that may affect validation.
Utilize regular expressions for more flexible URL validation.
Q2. How to read data from an XL file using selenium
You can read data from an Excel file using Apache POI library in Selenium.
Use Apache POI library to interact with Excel files
Create a FileInputStream object to read the Excel file
Create a Workbook object to represent the Excel file
Get the desired sheet from the Workbook
Iterate through rows and cells to read data
Q3. How to perform Mouse actions
Mouse actions can be performed using Selenium WebDriver by using Actions class
Create an instance of Actions class
Use methods like moveToElement, click, doubleClick, contextClick, dragAndDrop, etc.
Perform the desired action by calling the respective method on the Actions object
Q4. Oops Concepts of Java
Oops Concepts of Java are fundamental principles of object-oriented programming.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Inheritance: Allows a class to inherit properties and behavior from another class.
Polymorphism: Ability of a method to do different things based on the object it is acting upon.
Abstraction: Hiding the implementation details and showing only the necessary features of an object.
Q5. Alert handling in selenium
Alert handling in Selenium involves handling pop-up alerts, confirmation alerts, and prompt alerts.
Use driver.switchTo().alert() method to handle alerts
To accept an alert, use alert.accept() method
To dismiss an alert, use alert.dismiss() method
To get text from an alert, use alert.getText() method
To send text to a prompt alert, use alert.sendKeys() method
Q6. Waits in selenium
Waits in Selenium are used to make the automation script wait for a certain condition to be met before proceeding.
Implicit Wait: Waits for a certain amount of time before throwing a NoSuchElementException.
Explicit Wait: Waits for a certain condition to be met before proceeding.
Fluent Wait: Waits for a condition with a defined maximum amount of time.
Thread.sleep(): Pauses the execution for a specified amount of time.
More about working at IBS Software Services
Top Automation Tester Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month