1. What is data driven framework?
This frame work is used when an application is test with multiple sets of data. The data is passed to the scripts from data files like excel files, csv files, ODBC (Open Database Connectivity) and ADO (ActiveX Data Objects) objects.
Data driven framework is a systematic approach to test an application. It may contain all the structured information like data driven files, library functions, and user defined functions. Using the driver script, we can import theses files as a input to the application and test it. This is called data driven frame work. Data driven approach is being by most of the industries
2 what is keyword, hybrid framework?
Frame Work is the model or structure we follow for a Project. It is the approach that we follow to automate the Project. There are so many types of framework in QTP.
1. Data driven frame work
2. Keyword driven frame work
3. Module driven framework
4. Hybrid driven frame work
The framework you choose depends on the model of your Project. Usually most of projects fall under hybrid driven frame work.
Data driven framework:
Keyword driven framework:
Module driven frame work:
Hybrid Frame work:
This will be the combination of the any frameworks like Keyword driven+DataDriven or Data driven + modular driven. we will divide entire project in to modules and write functions or procedures for each and every module and automate the project. Hybrid driven framework: it is combination of Data driven and module driven framework.Firstly we should add the objects to repository ( Shared repository is preferable) Then we can generate/write scripts for each functionality and save them as the library files ( .vbs files)Then we have to associate all these library files(which are generated to test different functionalities) to Quick Test. Here we divide the entire project in to modules and start automation by writing data driven scripting for each one of them. We will have test data either in excel sheet or flat files or from database...we will pass that test data in to the script and perform data driven testing.
3 what is iframe?
An <iframe></iframe> element allows the placement of an inline frame within an HTML document, which allows the display of another, separate document. Any content between the start and close tag of the <iframe> element is ignored.
There are various ways of selecting an IFrame with selenium and accessing data within the IFrame: By Name:selenium.selectFrame("mainFrame"); //name of the IFrame
By DOM:
Remember index starts at 0, so "index=1″ will select the second IFrame. We can call the selectFrame() function multiple times to select the nested IFrames:
selenium.selectFrame("index=1″);
selenium.selectFrame("index=1″); will select the second IFrame within the second IFrame from the root
4 what is difference b/w xpather and xpath checker?
Firebug - the right-click "copy XPath" command copies the path as all lower-case, and some XML parsers (like the MXSML parser used in Final Builder) are case-sensitive - so you'll need to correct the casing of your Firebug-copied XPath statement otherwise your parser won't find any matching nodes.
XPather
...generates
The XPather is a simple
selenium.selectFrame("dom=window.frames[1]"); //second IFrame By Index: selenium.selectFrame("index=1″); //second IFrameXPaths while browsing or inspecting HTML/XML/*ML documents; evaluates your XPaths and inspects the results; extracts the content.Firefox extension that integrates both with the browser and its DOMInspector. Thus, is't very lightweight and cross-platform. It is valuable mainly as a web/XML-app development and hacking tool.XPath Checker XPather
String-match Patterns
Feature rich XPath generator, editor, inspector and simple extraction tool...
5 what is diff b/w Firefox and chrome and ie?
à Selenium scripts will run very fast in Firefox when we compare with the IE.
6 .how can u capture the entire pages, one page in single window? How it use I mean that cmd?
- filename - the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code.
- kwargs - a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options:
background
the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text).
7. How many types of pattern matching, list of it? Like regular expressions, group exp,exact expressions?
Various Pattern syntaxes are available for matching string values:
glob:
Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a kind of limited regular-expression syntax typically used in command-line shells. In a glob pattern, "*" represents any sequence of characters, and "?" represents any single character. Glob patterns match against the entire string.
regexp:
Match a string using a regular-expression. The full power of JavaScript regular-expressions is available.
exact:
Match a string exactly, verbatim, without any of that fancy wildcard stuff.
If no pattern prefix is specified, Selenium assumes that it's a "glob" pattern.
8 what is diff b/w wait for page to load, thread. Sleep, set speed?
Sleep, suspends the current thread for a period of time.
The expiration of that time is what will make the thread runnable.
Wait, suspends the current thread until some event has done.
The expiration of that time is what will make the thread runnable.
Wait, suspends the current thread until some event has done.
9 what are the different startup modes in selenium RC
à Mainly we had 2 types to startup modes in selenium RC.
you can launch Selenium Remote Control server using following command ( Make sure that you are into directory where selenium-server.jar is located or this directory is in your path variable ) -
java -jar selenium-server.jar
This command should start Selenium Server on your machine and your automation scripts are ready to interact with your web application using this server. You can leave this server up and running while you are developing and executing your automation scripts. If you wish, you can also start Selenium Remote Control in interactive mode and start playing with its various commands on command prompt itself. In order to do that, you need to supply a command line option called interactive.
java -jar selenium-server.jar -interactive
Apart from this there are many command line options that you can specify while starting selenium RC.
-port :
-timeout : an integer number of seconds before we should give up
-interactive:
-singleWindow:
-profilesLocation:
-forcedBrowserMode : sets the browser mode to a single argument (e.g. "*iexplore") for all sessions, no matter what is passed to getNewBrowserSession
-forcedBrowserModeRestOfLine :
-userExtensions :
-browserSessionReuse:
-firefoxProfileTemplate <dir>:
-debug: puts you into debug mode, with more trace information and diagnostics on the console
-browserSideLog:
-ensureCleanSession:
-trustAllSSLCertificates:
-log :
-htmlSuite :
-proxyInjectionMode:
-dontInjectRegex :
-userJsInjection :
-userContentTransformation :
10 how to automate flash based application?
Both selenium RC and selenium Webdriver can be used for flash/flex application testing. Procedure is same for testing flash and flex applications using selenium. FlashSelenium API in Selenium RC helps us to test flash/flex based applications using RC. While in webdriver, you need to make your own custom Javascript Execution functions in order to test flash applications using Selenium. But in order to test such appications, you need to make sure that you have the access to source code of the application. This means that you cannot just go and test any flash application present on the internet.
To test flash application u need to add below flash jar file to the eclipse.
"Flashselenium-java-client-extension.jar"
à While writing the code u need to import the flash lib
import com.thoughtworks.selenium.FlashSelenium;
Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension. Please see http://www.screengrab.org and http://snapsie.sourceforge.net/ for details.
Arguments:
An interactive editor for XPath expressions