Infy JAVA SELENIUM
Infy JAVA SELENIUM
Childclass method.
Write the java program to count the occurrence of character from a string
There is a variable declared inside the Interface. Can we change the value of
the variable?
From Manual:
☒ Automation ☒
Manual:
What are test design techniques? Explain BVA and ECP with some
examples?
Explain STLC
Explain Bug Life Cycle
What is the difference between bug and defect?
What are severity and priority?
Explain SDLC
What are the differences between smoke and sanity testing?
Selenium Real Time Interview Questions
What are the Selenium Tools, and Testing framework that you are using in
your Current Project?
Object Identification.
Debugging Issues. etc…
Did you find any Test Scenarios that not to be automated in your project
using Selenium?
Ans: Yes, We find some Some Test Scenarios in our Current project, Functionalities
that require more user interaction, Functionalities that require Dynamic test data
submission.
What Defect management / Test management tool you used in your project?
Ans: We are using the Jira Test Management tool in our project with Selenium.
How you communicated with the development team to resolve the issues.
Ans: We communicate Development team via Our Test Manager.
Did you involve in the Selenium Test environment Setup?
Ans: Yes, I involved in Selenium Environment Setup in my Current Project. As per
my project, we selected Java, Selenium WebDriver and TestNG Framework, and
Maven.
What is Selenium?
Answer: Selenium is a browser automation tool that lets you automate operations
like – Type, Click, and Selection from a drop-down of a web page.
What are the element locators available with Selenium, which could be used
to locate elements on a web page?
Answer: There are mainly 4 locators used with Selenium
Html ID
Html Name
Html Tagname
Html Class Name
XPath locator
CSS locators
Link Text
Partial Link Text
Can I control the speed and pause test execution in Selenium IDE?
Answer: Selenium IDE provides a slider with Slow and Fast pointers to control the
speed of execution.
I see two types of the check with Selenium – verification, an assertion, what’s
the difference between the two?
Answer: A verification check lets test execution continue even in the wake
of failure with a check, while assertion stops the test execution. Consider an
example of checking the text on a page, and you may like to use the verification
point and let test execution continue even if a text is not present. But for a login
page, you would like to add an assertion for the presence of text box login as it
does not make sense to continue with test execution if the login text box is not
present.
I don’t see checkpoints added to my tests while using Selenium IDE, how do I
get them added to my tests?
Answer: You need to use the context menu to add checkpoints to your Selenium
IDE tests.
Name of Command
Element Locator (also known as Target)
Value (required when using echo, wait, etc.)
There is an id, name, XPath, CSS locator, which one should I use?
Answer: If there are constant names/IDs available, then they should be used
instead of XPath and CSS locators. If not, then CSS locators should be given
preference as their evaluation is faster than XPath in most modern browsers.
I have stored the result of an evaluation; can I print it in IDE to check its
value?
Answer: You can use the echo command as following to check the stored value in
Selenium IDE –
storeText
css=input#s
var1
echo
${var1}
Selenium has recorded my test using XPath, how do I change them to CSS
locator?
Answer: You can use the drop-down available next to Find in Selenium to change
the element locator used by Selenium
I have written one js extension; can I plug it in Selenium and use it?
Answer: You could specify a js extension in the “Options” window of Selenium IDE –
I have converted my Selenium IDE tests to java, but I am not able to execute
them, execution options, as well as the Table tab of Selenium IDE, is disabled
Answer: This is because Selenium IDE does not support the execution of the test in
any other language than Selenese
(the language of Selenium IDE). You can convert Selenium IDE in a language of your
choice and then use
Selenium 1.0 to execute these tests in that language.
I want to use only Selenese as my test script language but still want to
execute tests in other browsers, how do I do that?
Answer: You can execute your Selenese test in another browser by specifying the
“htmlSuite” followed by the path of your
Selenese suite while starting the Selenium Server. Selenium Server would be
covered in detail in question
about Selenium RC.
I have added one command in the middle of the list of commands, how do I
test only this new command?
Answer: You can double click on the newly added command, and Selenium IDE
would execute only that command in
browser.
Can I make Selenium IDE tests begin test execution from a certain command
and not from the very first command?
Answer: You could set a command as a “start” command from the context menu.
When a command is set as a start command, then a small green symbol appears
before the command. The same context menu can be used to toggle this option
Are there other tools available outside Selenium IDE to help me tests my
element locators
Answer: You could XPath checker
https://addons.mozilla.org/enUS/firefox/addon/xpathchecker/ to test your XPath
locators and Firefinder (a Firebug add-on) to test you, CSS locators. Firefinder can
also be used to test XPath locators.
How can I use the looping option (flow control) is Selenium IDE
Answer: Selenese does not provide support for looping, but there is an extension
that could be used to achieve the same.
Can I use a screen coordinate while using the click command? I want to click
on a specific part of my element.
Answer: You would need to use the clickAT command to achieve. the clickAt
command accepts element locator and x, y
coordinates as arguments – clickAt(locator, coordString)
Can I get data from a specific HTML table cell using Selenium IDE?
Answer: Use the storeTable command to get data from a specific cell in an HTML
table, following example store text from cell 0,4 from an HTML table
storeTable
css=#tableId.0.4
textFromCell
I want to make a Selenium IDE record and display CSS locator followed by
other locators, is it possible to give high priority to CSS locator in Selenium
IDE?
Answer: You can change the default behavior of Selenium IDE > element locator
preference by creating a js file with the following– LocatorBuilders.order = [‘css:
name’, ‘CSS: id’, ‘id’, ‘link’, ‘name’, ‘XPath: attributes’]; And add this file under
“Selenium IDE Extension” under Selenium Options.
Assert command will stop the execution of the test case if verification fails. It will log
an error and will not proceed with the execution of the rest of the test case. We use
assertions in scenarios where there is no point proceeding further if the expected
output is not matched.
It’s pretty simple. Use assertions when you want to stop the execution of a test case
if the expected output is not matched and use verification when you still want to
proceed execution of a test case if the expected output is not matched.
List (Interface)
Map (Interface)
In Map, we used to store the data in key and value pairs, we may have
duplicate values but no duplicate keys
In Map we don’t have iterator() method, but we can get the keys by calling the
method keySet()
Map m; // insert values
Set s = m.keySet();
// Get Map keys into the Set and then iterate this Set object normally
// m.keySet() returns Set object with Map keys
Iterator iter = s.iterator();
Addition.java
JUnit provides overloaded assertion methods for all primitive types and Objects and
arrays (of primitives or Objects). The parameter order is the expected value,
followed by an actual value. Optionally the first parameter can be a String message
that is output on failure. There is a slightly different assertion, assertThat that has
parameters of the optional failure message, the actual value, and a Matcher object.
Note that expected and actual are reversed compared to the other assert methods.
Annotations.
Flexible test configuration.
Support for data-driven testing (with @DataProvider).
Support for parameters.
Allows distribution of tests on slave machines.
Powerful execution model (no more TestSuite).
It is supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc…).
Dependent methods for application server testing.
If you want to learn TestNG, you can download it and see its documentation at
“http://testng.org/doc/index.html.” TestNG is extensively used in Selenium
Automation and Code testing instead of Junit due to its advantages over it. Using
TestNG Selenium automation becomes simplified, and also the Parallel execution
using Selenium Grid becomes easy.