**WebDriver doesn't support record and playback feature.
**WebDriver is a purely object oriented tool.
**Captcha and Bar code readers cannot be tested using Selenium.
**windows pop up cannot be handled using Selenium.
**Single Slash “/” – Single slash is used to create Xpath with absolute path.
**Double Slash “//” - Double slash is used to create Xpath with relative path.
**find if an element in displayed on the screen?
**To get a text of a web element?
String Text = driver. findElement ( By.id( “Text”)). getText ( );
**To select value in a dropdown?
Select selectByValue = new Select( driver. findElement ( By.id( “SelectID_One”)));
Select selectByVisibleText = new Select (driver. findElement ( By.id( “SelectID_Two”)));
Select selectByIndex = new Select( driver. findElement ( By.id( “SelectID_Three”)));
**Different types of navigation commands?
**To click on a hyper link using linkText ?
**When do we use findElement ( ) and findElements ( )?
**Difference between driver. close( ) and driver. quit command?
**How can we handle web based pop up?
String getText( ) – The getText ( ) method returns the text displayed on the alert box.
**How to assert title of the web page?
//verify the title of the web page
**How to retrieve css properties of an element?
**How to capture screenshot in WebDriver?
@Test
{
// Code to capture the screenshot
File scrFile = ((TakesScreenshot) driver). getScreenshotAs ( OutputType. FILE);
// Code to copy the screenshot in the desired location
}
}
**How to set test case priority in TestNG ?
@Test( priority=0)
}
@Test( priority=1)
}
@Test( priority=2)
}
}
**Advantage of Test Automation framework
Reusability of code
Maximum coverage
Recovery scenario
Low cost maintenance
Minimal manual intervention
Easy Reporting
**What are the different types of frameworks?
Module Based Testing Framework: The framework divides the entire “Application Under Test” into number of logical and isolated modules. For each module, we create a separate and independent test script. Thus, when these test scripts taken together builds a larger test script representing more than one module.
Library Architecture Testing Framework: The basic fundamental behind the framework is to determine the common steps and group them into functions under a library and call those functions in the test scripts whenever required.
Data Driven Testing Framework: Data Driven Testing Framework helps the user segregate the test script logic and the test data from each other. It lets the user store the test data into an external database. The data is conventionally stored in “Key-Value” pairs. Thus, the key can be used to access and populate the data within the test scripts.
Keyword Driven Testing Framework: The Keyword driven testing framework is an extension to Data driven Testing Framework in a sense that it not only segregates the test data from the scripts, it also keeps the certain set of code belonging to the test script into an external data file.
Hybrid Testing Framework: Hybrid Testing Framework is a combination of more than one above mentioned frameworks. The best thing about such a setup is that it leverages the benefits of all kinds of associated frameworks.
Behavior Driven Development Framework: Behavior Driven Development framework allows automation of functonal validations in easily readable and understandable format to Business Analysts, Developers, Testers, etc.
Selenium IDE is missing certain vital features of a testing tool: conditional statements, loops, logging functionality,
re-execution of failed tests and screenshots taking capability.
Selenium IPhone Driver/Android Driver for running tests on Mobile Safari & Android browsers.
Selenium is basically used for the functional/Regression/Integration testing of web based applications & also Selenium is used for UAT (User Acceptance Test)
**The following commands are available within Selenium for processing Alerts:
• getAlert ( )
• assertAlert ( )
• assertAlertNotPresent ( )
• assertAlertPresent ( )
• storeAlert ( )
• storeAlertPresent ( )
• verifyAlert ( )
• verifyAlertNotPresent ( )
• verifyAlertPresent ( )
• waitForAlert ( )
• waitForAlertNotPresent ( )
• waitForAlertPresent ( )
The AlertPresent( ) and AlertNotPresent( ) functions check for the existence or not of an alert – regardless of it’s content. The Alert( ) functions allow the caller to specify a pattern which should be matched.
The getAlert ( ) method also exists in Selenium RC, and returns the text from the previous Alert displayed.
**Assertions
**Selenium WaitFor Commands?
Other waitFor commands : Selenium has several other wait command like waitForText , waitForPopup and so on. These commands are generically called Synchronization commands.
No comments:
Post a Comment