Sei sulla pagina 1di 11

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. The designed Data driven automation framework is shown as below figure 1.

Fig 1

Data driven framework is a systematic approach to test an application. It may contain all the structured information like data driven files, library functions, 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: 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.

Keyword 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. Module driven frame work: 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. Hybrid Frame work: This will be the combination of the any frameworks like Keyword driven+DataDriven or Data driven + modular driven. 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: selenium.selectFrame(dom=window.frames[1]); //second IFrame By Index: selenium.selectFrame(index=1); //second IFrame 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 XPaths while browsing or inspecting HTML/XML/*ML documents; evaluates your XPaths and inspects the results; extracts the content. The XPather is a simple 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 An interactive editor for XPath expressions XPather 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? captureEntirePageScreenshot ( filename,kwargs ) 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: 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 patternmatching ,list of it? like regularexpressions, group exp,exact expressions? String-match Patterns Various Pattern syntaxes are available for matching string values: glob:pattern 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:regexp Match a string using a regular-expression. The full power of JavaScript regular-expressions is available. exact:string 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 forpage toload, 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. 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 : the port number the selenium server should use (default 4444) -timeout : an integer number of seconds before we should give up -interactive: puts you into interactive mode. See the tutorial for more details -singleWindow: puts you into a mode where the test web site executes in a frame. This mode should only be selected if the application under test does not use frames. -profilesLocation: Specifies the directory that holds the profiles that java clients can use to start up selenium. Currently supported for Firefox only.

-forcedBrowserMode : sets the browser mode to a single argument (e.g. "*iexplore") for all sessions, no matter what is passed to getNewBrowserSession -forcedBrowserModeRestOfLine : sets the browser mode to all the remaining tokens on the line (e.g. "*custom /some/random/place/iexplore.exe") for all sessions, no matter what is passed to getNewBrowserSession -userExtensions : indicates a JavaScript file that will be loaded into selenium -browserSessionReuse: stops re-initialization and spawning of the browser between tests -avoidProxy: By default, we proxy every browser request; set this flag to make the browser use our proxy only for URLs containing '/selenium-server' -firefoxProfileTemplate <dir>: normally, we generate a fresh empty Firefox profile every time we launch. You can specify a directory to make us copy your profile directory instead. -debug: puts you into debug mode, with more trace information and diagnostics on the console -browserSideLog: enables logging on the browser side; logging messages will be transmitted to the server. This can affect performance. -ensureCleanSession: If the browser does not have user profiles, make sure every new session has no artifacts from previous sessions. For example, enabling this option will cause all user cookies to be archived before launching IE, and restored after IE is closed. -trustAllSSLCertificates: Forces the Selenium proxy to trust all SSL certificates. This doesn't work in browsers that don't use the Selenium proxy. -log : writes lots of debug information out to a log file -htmlSuite : Run a single HTML Selenese (Selenium Core) suite and then exit immediately, using the specified browser (e.g. "*firefox") on the specified URL (e.g. http://www.google.com"). You need to specify the absolute path to the HTML test suite as well as the path to the HTML results file we'll generate.

-proxyInjectionMode: puts you into proxy injection mode, a mode where the selenium server acts as a proxy server for all content going to the test application. Under this mode, multiple domains can be visited, and the following additional flags are supported: -dontInjectRegex : an optional regular expression that proxy injection mode can use to know when to bypss injection -userJsInjection : specifies a JavaScript file which will then be injected into all pages -userContentTransformation : a regular expression which is matched against all test HTML content; the second is a string which will replace matches. These flags can be used any number of times. A example of how this could be useful: if you add "-userContentTransformation https http" then all "https" strings in the HTML of the test application will be changed to be "http". 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; 11 how to handle popup,alert? selenium.chooseCancelOnNextConfirmation(); selenium.chooseOkOnNextConfirmation(); These method calls should be executed before the event that generates the Pop-up windows /JavaScript alerts. e.g. if clicking a Delete button pop-up a java script alert with OK and Cancel button then functions call would be. selenium.chooseOkOnNextConfirmation(); selenium.click("DeleteButton"); This would instruct selenium to click OK on the pop-up window that appears as a result of clicking the delete button.

Sample Soure Code: //Click 'Ok' button on pop-up window selenium.chooseOkOnNextConfirmation(); //Click 'Delete' button selenium.click("//img[@alt='Delete']"); assertTrue(selenium.getConfirmation().matches("^Conferm cancel [\\s\\S]$")); selenium.waitForPageToLoad("90000000"); selenium.click("sm-event.ADClient-ADSearchBase.Back"); selenium.waitForPageToLoad("90000000) isAlertPresent() - this would return a boolean (true/false) based on the alert existence

12 how to upload a file in rc? directly we can not upload the files using selenium rc.For this we need to use any thirdparty tools like Autoit. 13 how to clickscrollbar button in web app? selenium.getEval("window.scrollTo(0,0)"); 14 how to navigate from parent,child tags in xpath? This will be depents on the code which is generated bu using firebug tool.

1.what selenese cmd can be used to help to debug a regexp? Echo variableName to check the proper functioning of your regular expression. 2.difference betwwen silktest and selenium,excluding the price? Selenium is completely free test automation tool, while Silk Test is not. Only web applications can be testing using Selenium testing suite. However, Silk Test can be used for testing client server applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and Linux. However, Silk Test is limited to Internet Explorer and Firefox. Silk Test uses 4Test scripting language. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby. 3.if a selenium function requires a script arguments,what would that argument look like in general term?

StoreEval(script, variable) and storeExpression(expression, variableName) 4.selenium function require a pattern argument,what five prefixes might that argument have? glob, regexp, exact, regexpi 5.what is the regular expression sequence that loosely translate to "anything or nothing"? glob: Real* or regexp:Real.* 6.what selenium functionality uses wildcards? 7.which wildcard can selenium ide support? *, [ ] 8.what cmd simulates selecting browser's back button? goBack ( ) 9.if the testframe conain several test cases ,how can one execuite just select one testcase from that testframe? 10.what globbing functionality not supported by side? 11.what r two ways to match an asterisk with in a salenese regexp? 12.what is the oddity associate with testing an alert? 13.what selenese cmd is used to choose an item from list? selenium.select("locator", "value=REQUIRED VALUE") selenium.select("locator", "label=REQUIRED VALUE") 14.where did the name selenium come from? Selenium, Se (from Greek "" , selene, meaning "Moon") was discovered in 1817 by Jns Jakob Berzelius, who found the element associated with Te and S 1. Tellurium (from Latin tellus, meaning "Earth") and with 2. Sulfur (from Sanskrite sulvari, is biblically associated with "hell", -Genesis) in the process of making sulfuric acid. (source: WikiPedia, 2010-04-02) Selenium (Greek selene meaning "Moon") was discovered in 1817 by Jns Jakob Berzelius who found the element associated with Tellurium (named for the Earth). 15.which selenium cmd simulates selecting a link? click, clickandWait, ClickAt, ClickAtandWait, DoubleClick, DoubleClickandWait, doubleClickAt, doubleClickAtandWait

1. how selenium RC work at core components level? Selenium RC works with these 2 components: Remote Control Server and Client Libraries.

(Selenium RC) Remote Control Server receives the Selenium commands from the test program using HTTP GET/POST requests. Each command is passed to the browser using Selenium-Core JavaScript commands. SeleniumCore is a JavaScript program, actually a set of JavaScript functions which interprets and executes Selenese commands using the browsers built-in JavaScript interpreter. (Selenium RC) Client Libraries are the Interface between each programming language and Selenium-RC server; they provide a programming function for each Selenese command. Client libraries pass the Selenese commands to the

Selenium Server, then receive the result of the command and pass it to the test program. You can store the result of the command as a variable and do a specific action in your program, for example take a screenshot if the result is interpreted as failed.

2. When to use proxy injection mode? Selenium does not support testing in the Proxy Injection mode when the application to be tested is behind a internet/web proxy.

3.how to handle ssl or https using selenium rc? 4.how to handle model dilog? 5.how you manage object repository? 6.how to extend selenium rc for user defind function? 7.it is possible to select a text and compare text? 8.how to navigate to sibling node in xpath? 9.how to connect to excel sheet for test data reading? 10.which reported to or component you used? 11.how logging handled in your automation framework? 12. explain geteval and runscript functions? 13.how you handle auto compelte search in selenium rc automation?what r prerequisites to run seleniumweb driver? 14.how to navigate with browser buttons in selenium webdriver? 15.how to convert the 1.0 tests to 2.0? 16.what is webdriver backed selenium? 17.which version of selenium ide supports webdriver? 18.how to invoke an application in webdriver? 19.which of side cmd not supported in webdriver? 20.what is implicit and explicit wait in selenium webdriver?

Potrebbero piacerti anche