0% found this document useful (0 votes)
4 views9 pages

Difference Between Find Element and Find Elements

The document outlines various software testing concepts and practices including the differences between findElement and findElements in Selenium, smoke and sanity testing, regression and retesting, and severity versus priority. It also covers programming concepts such as inheritance, encapsulation, and the differences between lists and sets. Additionally, it provides an overview of Appium Doctor, alpha and beta testing, and the architecture of a microservices-based application.

Uploaded by

Neeraj singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views9 pages

Difference Between Find Element and Find Elements

The document outlines various software testing concepts and practices including the differences between findElement and findElements in Selenium, smoke and sanity testing, regression and retesting, and severity versus priority. It also covers programming concepts such as inheritance, encapsulation, and the differences between lists and sets. Additionally, it provides an overview of Appium Doctor, alpha and beta testing, and the architecture of a microservices-based application.

Uploaded by

Neeraj singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Difference between find element and find elements

There are differences between findElement and findElements method in


Selenium webdriver. Both of them can be used to locate elements on a
webpage. The findElement points to a single element, while the findElements
method returns a list of matching elements.

Following is the difference between Sanity and Smoke testing:

Smoke testing

Smoke Testing is performed to ascertain that the critical functionality of the


program is working fine
The objective of this testing is to verify the “stability” of the system in order to
proceed with more rigorous testing
This testing is performed by the developers or testers
Smoke testing is usually documented or scripted
Sanity Testing
Sanity Testing is done to check the new functionality/bugs have been fixed.
The objective of the testing is to verify the “rationality” of the system in order to
proceed with more rigorous testing
Sanity testing in software testing is usually performed by testers
Sanity testing is usually not documented and is unscripted

Retesting vs Regression Testing

Regression Testing is carried out to confirm whether a recent program or code change has not adversely

affected existing features

The purpose of Regression Testing is that new code changes should not have

any side effects to existing functionalities

Defect verification is not the part of Regression Testing

Re-testing
Re-testing is carried out to confirm the test cases that failed in the final
execution are passing after the defects are fixed
Re-testing is done on the basis of the Defect fixes
Priority of re-testing is higher than regression testing, so it is carried out before
regression testing
Difference between severity and priority?
o Severity is the impact of a bug on the system's functionality.
Priority is the order in which a bug should be fixed, based on its severity and other
factors like business impact.

/ Cast the WebDriver instance to TakesScreenshot


//TakesScreenshot screenshot = (TakesScreenshot) driver;

// Capture the screenshot as a File object


//File sourceFile =
screenshot.getScreenshotAs(OutputType.FILE);
Scroll the page
JavascriptExecutor js=(JavascriptExecutor) driver;

js.executeScript("window.scrollTo(1000,document.body.scrollHeight)")
;
Thread.sleep(2000);
JavascriptExecutor js1=(JavascriptExecutor) driver;
js1.executeScript("window.scrollTo(-
1000,document.body.scrollDown)");*/

What is the difference between list and set?


 A List allows duplicate elements and maintains the order of insertion. Common implementations
include ArrayList and LinkedList.
 A Set does not allow duplicate elements and does not guarantee the order of elements. Common
implementations include HashSet, LinkedHashSet, and TreeSet.

difference between overloading and overriding?


o Overloading: Multiple methods with the same name but different parameter lists within the same
class.
o Overriding: A subclass provides a specific implementation of a method that is already defined in its
superclass

Difference Encapsulation and Abstraction?


o Encapsulation: Hiding the internal state and requiring all interaction to be performed
through an object's methods.
o Abstraction: Hiding the complex implementation details and showing only the essential
features of the object.
Difference between overloading and overriding?
o Overloading: Multiple methods with the same name but different parameter lists within
the same class.
o Overriding: A subclass provides a specific implementation of a method that is already
defined in its superclass.

Explain about Inheritance.


o Inheritance is an object-oriented concept where one class (subclass) inherits the fields
and methods of another class (superclass). This allows for code reuse and establishes a
relationship between the parent and child classes.

Difference between Scenario and Scenario Outline?


 Scenario: Represents a single example of a behaviour or functionality in a
feature file. It contains a series of steps that describe the actions and expected
outcomes of the scenario.
 Scenario Outline: Allows you to define a template for a scenario with
placeholders for inputs or parameters. It is followed by examples table, which
provides concrete values for the placeholders. During execution, the scenario
outline is run once for each set of example values provided in the examples
table.
// Initialize Actions class
Actions actions = new Actions(driver);
// Click
actions.click(elementToClick).perform();
// Double click
actions.doubleClick(elementToDoubleClick).perform();
// Right click
actions.contextClick(elementToRightClick).perform();
// Click and hold
actions.clickAndHold(elementToClick).perform();
// Release actions.release(elementToClick).perform();
// Drag and drop
actions.dragAndDrop(sourceElement, targetElement).perform();
// Drag and drop by offset
actions.dragAndDropBy(sourceElement, 100, 200).perform();
// Move to element
actions.moveToElement(elementToHover).perform();
// Move to element with offset
actions.moveToElement(elementToHover, 50, 50).perform();
// Send keys
actions.sendKeys(elementToClick, "text to send").perform();
Difference between smoke and sanity tests?
o Smoke tests are basic tests to check if the major functionalities of the software
work. Sanity tests are narrow and focused tests to verify specific functionality or
code changes.
4. Difference between regression and retesting?
o Regression testing ensures that previously developed and tested software still
performs after a change. Retesting is the process of checking if a specific bug
has been fixed after development.
5. Difference between functional and regression testing?
o Functional testing verifies that each function of the software application
operates in conformance with the requirement specification. Regression testing
verifies that new code changes don’t break existing functionality.
6. Difference between severity and priority?
o Severity is the impact of a bug on the system's functionality. Priority is the
order in which a bug should be fixed, based on its severity and other factors like
business impact.
7. What is appium doctor ?
Appium Doctor is a command-line tool that helps diagnose and fix common setup
issues with the Appium environment. Appium is an open-source automation tool
for testing mobile applications on Android and iOS. Appium Doctor assists in
ensuring that all the necessary dependencies and configurations are correctly set
up, which is crucial for the smooth functioning of Appium.
8. difference between alpha and beta testing

Parameters Alpha Testing Beta Testing

Alpha testing uses


Beta testing commonly uses
both white box and
black-box testing.
Technique Used black box testing.

Alpha testing is
performed by testers Beta testing is performed by
who are usually clients who are not part of
internal employees of the organization.
Performed by the organization.
Parameters Alpha Testing Beta Testing

Alpha testing is
Beta testing is performed at
performed at the
the end-user of the product.
Performed at developer’s site.

Reliability and
Reliability, security and
security testing are
Reliability and robustness are checked
not checked in alpha
during beta testing.
Security testing.

Beta testing also


Alpha testing ensures
concentrates on the quality
the quality of the
of the product but collects
product before
users input on the product
forwarding to beta
and ensures that the product
testing.
Ensures is ready for real time users.

Alpha testing
Beta testing doesn’t require
requires a testing
a testing environment or lab.
Requirement environment or a lab.

Alpha testing may


Beta testing requires only a
require a long
few weeks of execution.
Execution execution cycle.

Most of the issues or


Developers can
feedback collected from the
immediately address
beta testing will be
the critical issues or
implemented in future
fixes in alpha testing.
Issues versions of the product.

9. what is Bug Life cycle


Architecture of your current application?
The architecture of our current application is a microservices-based architecture,
which
includes the following components:
 Frontend: Developed using React.js,java script jquery, design purpose,html css
bootstrap ajax it interacts with backend services via RESTful
APIs.
 Backend: Consists of multiple web service.cs page,interface,class
Each services is responsible for a specific functionality and communicates with
others through HTTP and messaging queues.
 Database: Uses SQL
 API Gateway: An API Gateway handles requests from the frontend and routes
them
to the appropriate web services.
 Authentication and Authorization: Implemented using OAuth 2.0 and JWT for
secure access to services.

Basic WebDriver Setup


WebDriver driver = new ChromeDriver();
System.setProperty("webdriver.chrome.driver", "path/to/chromedriver");
Open Url
driver.get("http://example.com");
Get the current URL:
String currentURL = driver.getCurrentUrl();
Get the page title:
String title = driver.getTitle();
Close the current window:
driver.close();
Quit the browser:
driver.quit();
Check if an element is displayed:
boolean isDisplayed = element.isDisplayed();
Check if an element is enabled:
boolean isEnabled = element.isEnabled();
Check if an element is selected (for checkboxes or radio buttons):
boolean isSelected = element.isSelected();
Handling Alerts
Switch to an alert
Alert alert = driver.switchTo().alert();
Accept an alert:
alert.accept();
Dismiss an alert:
alert.dismiss();
Get text from an alert:
String alertText = alert.getText();
Switch to a frame by index:
driver.switchTo().frame(0);
Switch to a frame by name or ID:
driver.switchTo().frame("frameNameOrId");
Switch to a frame by WebElement:
WebElement frameElement = driver.findElement(By.id("frameId"));
driver.switchTo().frame(frameElement);
Switch back to the main (parent) frame:
driver.switchTo().defaultContent();
Switch to a window by handle:
driver.switchTo().window("windowHandle");
Get the window handle of the current window:
String currentWindow = driver.getWindowHandle();
Get all window handles:
Set<String> allWindows = driver.getWindowHandles();
Handling Dropdowns
Select an option by visible text:
Select dropdown = new Select(driver.findElement(By.id("dropdownId")));
dropdown.selectByVisibleText("Option Text");
Select an option by value:
dropdown.selectByValue("optionValue");
Select an option by index:
dropdown.selectByIndex(2);
Get all selected options (for multi-select dropdowns):
List<WebElement> selectedOptions = dropdown.getAllSelectedOptions();
Deselect all options (for multi-select dropdowns)
dropdown.deselectAll();
Take a screenshot of the entire page:
File screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(screenshot, new File("path/to/save/screenshot.png"));
Take a screenshot of a specific element:
File screenshot = element.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(screenshot, new File("path/to/save/screenshot.png"));
Explicit wait:
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element =
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("elementId")));

You might also like