Trick Software Automation Questions Flashcards
What is the difference between an Assert and a Verify with Selenium Commands?
Assert allows to check whether an element is on the page or not. The test will stop on the step failed, if the asserted element is not available.
Verify command will check whether the element is on the page, if it is not then the test will carry on executing. In verification, all the commands are going to run guaranteed even if any of test fails.
What is one big difference between SilkTest and Selenium?
Selenium supports many browsers like Internet Explorer, Opera, Chrome, Firefox, Safari.
SilkTest supports only Internet Explorer and Firefox
Another difference is Selenium has many language bindings like Java, .Net, Perl, PHP, Python, Ruby under test while SilkTest uses 4Test scripting language to describe the test procedure.
Which browsers can Selenium IDE be run in?
FireFox
How does one get rid of the right-pointing green triangle?
Right click on that line and remove break point.
How can one add vertical white space between sections of a single test?
You can use vertical bars at the beginning of lines to produce blank lines in the output.
What does SIDE stand for?
Selenium Integrated Development Environment.
What regular expression special character(s) means “any character?”
- = star or asterisk
What distinguishes between an absolute and relative URL in SIDE?
Absolute will have Double Slash
Relative will have single slash
An absolute URL contains more information than a relative URL does. Relative URLs are more convenient because they are shorter and often more portable. However, you can use them only to reference links on the same server as the page that contains them.
How would one access a Selenium variable named “count” from within a JavaScript snippet?
${count} = dollar sign curly brackets count
What Selenese command can be used to display the value of a variable in the log file, which can be very valuable for debugging?
We can use echo command to log information in the test result output.
Where did the name Selenium come from?
Actually, Selenium is a chemical element name. But Thoughtworks used it for test automation framework api.
Which Selenium command(s) simulates selecting a link?
For simulating selecting a link, we can use findElement(By.Link(“LinkName”))
Which two commands can be used to check that an alert with a particular message popped up?
Use command VerifyAlertPresent
What command simulates selecting the browser’s Back button?
driver.navigate().back() command
If the Test Case frame contains several test cases, how can one execute just the selected one of those test cases?
Users can use “Play current test case” function of Selenium IDE
What is the generic name for an argument (to a Selenese command) which starts with //?
Xpath
What Selenese command is used to choose an item from a list?
Select command
How can one get SIDE to always record an absolute URL for the open command’s argument?
In the Selenium IDE options, check “Record Absolute URL” option.
What Selenese command and argument can be used to transfer the value of a JavaScript variable into a SIDE variable?
Use “store” command
Explain the different exceptions in Selenium WebDriver.
TimeoutException: This exception is thrown when a command performing an operation does not complete in the stipulated time
NoSuchElementException: This exception is thrown when an element with given attributes is not found on the web page
ElementNotVisibleException: This exception is thrown when the element is present in DOM (Document Object Model), but not visible on the web page.
NoAlertPresentException
StaleElementException: This exception is thrown when the element is either deleted or no longer attached to the DOM.
What is exception test in Selenium?
An exception test is an exception that you expect will be thrown inside a test class.
Why and how will you use an Excel Sheet in your project?
It can be used as data source for tests. An excel sheet can also be used to store the data set while performing DataDriven Testing
What is POM (Page Object Model)? What are its advantages?
Page Object Model is a design pattern for creating an Object Repository for web UI elements. Each web page in the application is required to have it’s own corresponding page class. The page class is thus responsible for finding the WebElements in that page and then perform operations on those WebElements.
improves code readability
multiple tests can use the same Object Repository
Reusability of code
What is Page Factory?
Page Factory gives an optimized way to implement Page Object Model. When we say it is optimized, it refers to the fact that the memory utilization is very good and also the implementation is done in an object oriented manner