Manual Testing Questions
Manual Testing Questions
Answer: Web-based applications need web servers to host them, visitors need interne t
connection and a browser to access the website and internally web sites process user requests and send
responses via hyper Text Transfer Protocol (HTTP). Multiple users can access same feature of web
application at same time simultaneously.
Examples of web-based applications are e-commerce portals for online purchase of products of our
choice (amazon.com, Flipkart, bookmyshow.com), websites of most of companies, universities, search
engines (google.com, altavista.com)
Answer: web-based applications require browsers such as (Internet Explorer, Chrome, Firefox, Safari,
Opera), and a reliable internet connection to explore. Web -based applications can be tested for
functionality testing for any invalid page redirects, broken links, page not displaying.
Working of web elements such as input field, drop-down list, checkbox, radio button, submit button.
verify for valid input data entered, methods used while data submits, compatibility tests for browsers
used, performance to test latency (time taken to access pages), delay in opening next pages or output,
and Security testing for verifying login for authentication.
Answer: Unit testing is primary test level, one way is static testing, where code is verified for syntax,
rules followed by organization which is conducted by developer, second way is dynamic testing where
small snippet of code is debug (tested) with sample test data to validate the output. Various tools for
unit testing are JUnit, Hansel, and Testing are used to verify code coverage.
Answer: When application build is released after bugs fixed from the developer, and or changes due to
additional requirement, the testing carried out is called sanity test, to verify that bugs are fixed, still
functionality is in place, and no new bugs or defects are observed. In case while running sanity tests,
bugs still exists, testers can reject the build.
Example of sanity test can be like remember me checkbox was installed against the bug raised, but
forget password link stops working, then it is a new bug.
present in application, and there is absence of ‘Page Not found’ message while accessing any page,
Forms and Pages have all usable web elements and display stable pages.
Example, drop down list in all the input form does not display it ems for user to select, due to any
reason, this if found during the smoke test, then tester will stop testing and can reject the build by
informing the short coming to development team.
Answer: Tester use testing experience, while testing an application, explores the features and learn
about how the application works, during testing, he makes note of how the application be have s, and
such tests are called exploratory testing. The requirement document is absent, and testers are exposed
to the application first time, without any test cases created.
Answer: Integration testing is the second level of testing after unit testing, where different modules are
combined together and then tested for verifying that data flow in sync between the modules and there
Example – During integration testing, IRCTC site can be checked where after searching train, booking
seats in particular train, when payment gateway , which is integrated in to application found not
working.
Answer: System testing is the third level of testing after integration testing, where the application under
test is tested for an end to end functionality, to confirm that it works as desired.
Example – matrimonial portal can be tested from registration, searching candidate, receiving contact
details and meet or fix appointments with prospects.
Selenium Questions:
What is the difference between the setSpeed() and sleep() methods?
Thread.sleep(): The current thread will stop for a specified period of time. It only waits once when the
command is given and takes only a single argument that is Integer format.
set sleep(): This command will stop the execution for every selenium command used only for
demonstration purposes and a slow web application.
Explain how you can find broken images on a page using the Selenium Web driver?
Answer: To find the broken images on a page using the Selenium web driver is
• Get XPath and get all the links on the page using the tag name
WebDriverException
NoAlertPresentException
NoSuchWindowException
NoSuchElementException
TimeoutException
Answer: driver. findElements() will not throw any exceptions instead it will return an empty list if the
element is not found on the current page.
This Subscribe button on the page has an ID with a dynamically changing number in it (‘334350’). This
keeps on changing every time you refresh the page. But it always starts with submit. So you can use a
relative XPath as given below to identify the web element:
2.Identify by index
Sometimes, you will have multiple elements with same locator value. For example there may be two
submit buttons with id starting with ‘Submit’. In this case you can use findElements method and locate
the element using the index.
driver.findElements(By.xpath(//*[contains(@id, ‘submit’).get(0).click();
Here get(0) is used to get the first web element with matching XPath.
API Testing:
What are the main differences between API and Web Service?
All Web services are APIs but not all APIs are Web services.
Web services might not contain all the specifications and cannot perform all the tasks that APIs would
perform.
A Web service uses only three styles of use: SOAP, REST and XML-RPC for communication whereas API
may be exposed to in multiple ways.
A Web service always needs a network to operate while APIs don’t need a network for operation.
Java:
Write a Java Program to Check the Pallindrom Number.
public static boolean isPallindrome(int num) {
int original = num;
int reversed = 0;
while (num > 0) {
int remainder = num % 10;
reversed = reversed * 10 + remainder;
num /= 10;
}
return original == reversed;
}
}
Write a Java Program to Calculate the factorial of any number.
public static int calculateFactorial(int num) {
int result = 1;
for (int i = num; i > 0; i--) {
result *= i;
}
return result;
}
}
Write a Java Program to find the highest number from Array.
public static void findHighest(int[] numbers) {
int highest = numbers[0];
for (int i = 1; i < numbers.length; i++) {
if (numbers[i] > highest) {
highest = numbers[i];
}
}
System.out.println("The highest number is " + highest);}
}