Www.krishnatraining.com



krishnatrainingusa@Selenium IDE: addon to FF browser: record and playback featureHow to install this addon: FF must Steps: 1) open FF browser and open 2) type selenium IDE download in the google search filed3) simply click on “downloads page- selenium” it will redirect us to selenium official website downloads page4) inorder to download that selenium IDE addon simply click on the latest version of IDE5) click on allow button and click on install button after successful installation it wil ask us to restart the browser simply restart the browserHow can we check whether that IDE was installed or not???Under FF browser options and under webdevelopers >>> selenium IDE will display >> simply click on that one it wil open a new window Perform a simple recording scenario in IDE:Scenario1: open , enter some value in search field and click on search buttonSimply we can conclude that whatever actions we were performing in FF browser IDE is capturing the scripts.So finally whatever actions we are perforimg in FF browser for those actions only IDE is going to capture the scripts if at all we are performing some action in other browsers like IE,chrom,safari IDE wont capture or records the scriptHow can we record a simple script in IDE???Open IDE window from browser webdevlopers Verify whether IDE was in recording mode or not ???At the extreme right end of IDE we can see on red button if that button was in enabled mode then only whatever actions we are performing in browser IDE will capture scripts for those actions. Means if that button was in disable mode and even we perform action in FF browser IDE wont capture scriptsInorder to capture the scripts with help of IDE we need to check 1st whether that IDE was in recording mode or not…How can we playback or execute the recorded test case:With the help of “Play current test case” option in IDEIn the log it will display a detailed information related to test case failure or test case passedOnce after test case got executed by simply looking into the color we can confirm whether our test case got executed successfully(pass means green color) or it was failed(red color)How can we save the test case and why we need to save test case???If we wont save the script means whenever it was required we need to record that. Instead of recording each and every time if we save that test case and whenever it was required simply call that test caseGoto file >> select save test case >> it wil display a new window under which select where you want to save that test case with desired name.Inorder to save any test case in IDE we need to give “.html” extension at lastExample: bing_search.htmlUsage of Reference option in IDE???The objective of this option in IDE is if we place our cursor on any cmd in IDE under reference it will display a detailed information about that cmd means how this cmd wil work and what are the various parameters we need to pass for that cmdWhether IDE is useful for us in real world???Yes , cmds we are discussing in IDE al the cmds we are going to discuss in RC as well.Locators: inorder to identify a object in the web page we are going for this locators concept. Means this concept is similar to objectspy in QTP. The ue of objectspy is we can get various kinds of properties supported for an object. Here for this selenium we are using firebug which is similar to objectspyHow can we install firebug ??? : firebug is an addon to ff browser: to identify various properties of an objectSteps: 1) open th browser and open google home page2) in the search field enter firebug addon3) click on “Firebug Addon to Firefox” link among the search results4) Click on “Add to Firefox” and click on install button automatically firebug will be installedWe can add multiple addons to FF browserHow can we verify whether firebug is installed or not???Simply right click on the browser on an object and in the list of options we can see ”Inspect Element with Firebug” or some time “Inspect Element”At the extreme right top most end of the browser we can see the firebugHow can we see various kinds of object properties???Simply right click on the object and select “Inspect Element with Firebug” after that a small window wil display within the browser in which few set of cmds were in highlighted mode by simply looking into that we can understand that the highlighted properties were related to our objectWhy we are going for this firebug? What is the use of this addon??Inorder to get various kinds of object properties we usually go for this addonIs this the only way we can get object properties or do we have some other way???There were 2 ways inorder to get object propertiesWith simple recording :Open IDE window keep our IDE recording mode and go to the browser , select the object for which we need to get the properties and perform some actions on that object.Goto to IDE and in the target it will display as dropdown try to observe the dropdown values.. so finally the dropdown values were the various kinds of properties supported for an objectWith simple recording we are getting various properties supported for an object then why we are going for firebug???We can identify object properties simply with firebug addonWith Firbug addon: Simply right click on the object and select “Inspect Element with Firebug” after that a small window wil display within the browser in which few set of cmds were in highlighted mode by simply looking into that we can understand that the highlighted properties were related to our objectHow can we identify an object with the properties disapled in firebug???Generally we can identify any object in webpage with below properties:Id: NameClassLinkText Xpathcsshow can we identify object with above properties???Syntax which we need to implement in IDE:Propertytype=propertyvalueWe can identify an object with any one the above properties..Id we were unable to identify then goto name property, someother propertyPropertytpe:id,class,name,link,,titlePropetyvalue: wecan get it from firebugExample: id= sb_form_q so we need to keep this syntax in targetassume that in a room there were 10 people we need to identify a single person from that 10 members. We simply know that person name only “murthy”.. if at all there were 3 people with the same name in the room ??? then we are identifying the required person with some other properties like his hight or color or various???With the default properties if selenium IDE was unable to identify object in webpage what we need to do??? Hpw can we handle these kind of situations???Xpath: if at all IDE was unable identify object in webpage with default properties then we are going for xpathSyntax://element[@propertytype=’propertyvalue’]< input/a/spanexample://input[@type=’submit’]//input[@value=’Log in’]Property type, property value we can get from firebug onlyThen what is this element???<s >Scenario: identify object properties for search text field in How can we use firebugSimply right click on the object for which we want to get the propertiesHow can we identify a link ????Link=linkname We can write xpath for links alsoIdentifying a link with entire text present on that link“Mailing List Archive”Syntax://element[contains(text(),’text present on that link’)]//a[contains(text(),'Test Channel Administrative Interface')]Steps:Simply Copy the text present on that link and right click on that link and observer the element in firebug//a[contains(text(),’ Customer Information Interface’)]Example://a[contains(text(),’ Mailing List Archive’)]Identifying alink with startingtext on the link“Mailing”//element[contains(text(),’text present on that link’)]Syntax://element[starts-with(text(),’starting text present on that link’)]//a[starts-with(text(),’Test’)]//a[starts-with(text(),’Order’)]Test Channel Administrative InterfaceSimple recording:Context menu:What is conextmenu???Assume we are testing crm app login scenario manually once after entering uid, pswd and clicking on sigin button by simply loking into logout linkUse: inorder to add verification points to our IDE script we are using this context menuWhere can we see this context menu???Goto browser simply right click on the browser where it is displaying list of options at last we can see “Show All Avilable commands” if we place our cousor there it wil display list of cmdsPrecondition: we need to open IDE window 1st then only we can see this context menuToo many cmds how can we understand those cmds??? In a simple way???So the context menu was divided into 5sets which is open, assert,verify,waitfor,store(Assert/verify/waitfor/store)Text present(Assert/verify/waitfor/store)title(Assert/verify/waitfor/store)Text(Assert/verify/waitfor/store)elementpresentPrefix is changing+suffix remains constantTextpresent,text,title,elementpresentAssert,verify,waitfor,storeTextpresent: it wil verify whether some text is there or not in the web page and it won’t consider how many times that text was there in the web page it means if the same text is there around 10 times in the web page it wil simply search for the 1st text and wil pass that commandText: it will verify whether text is there or not in the web page at a particular locationTitle: genereally in real time application wherever the page navigation scenarios were there , there we can keep this title as verification point.. because the title of the web page got changed from page to pageBing selenium bing selenium web browser automationElement present: it will verify whether an object(link,text field, button) is there or not in the web page … it will simply verify the object but it won’t consider text present on the objectScenario: assume that webpage was not loaded successfully and evn that text field and search button was not there in the webpageAssert,verify,: the purpose of these two is one and the same: inorder to verify some thing in the web pageAssert: it wil acts like mandatory verification pointVerify: it is not an mandatory verofocation pointwaitfor,store:Scenario1: usage of verification points: login to sugar crm and verify whether we were loggeg into application or not???After entering uid, pswd and click on sign inbutton how can we confirm whether we were logged into application or not??? By simply observing the home page after loginThe verification point after logged into app is “ Krishna Krishna “ text and logout linkDifferences between assert and verify with example????Assert: if at all the verification point was not there in the web page it will simply stop the execution at that cmd only, and it won’t continue remaining cmds executionVerify: eventhough verification point was not thre in web page it will simply continue remaining cmds executionTitle: we are verifying once after opening the application whether we landed to proper page or not with title as a verification pointLocators: id, name class Link=link nameSoon after we prepared test script we need to add verification point with either assert or verifyWaitfor and store: Store: it will store a value to a variableEx: int a=5 in c language or java language this is not in IDEString b=”murthy”;Differ???Thursday : record, all 3 filed , action cmd porpose each cmd, how can I add cmds in middle of my test case and how can I execute from middle of my test case1hr: 45min to 50mins and 25mins to clarify doubtsCommands in IDE??? 10cmds IDE RC alsoFor few cmds it contains cmd, target, value and few cmds cmd , targetLogin to application: assert logout linkif the logout link displayed in browser means we succesfuly logged into application we can proceed with remaining test cases like user creationCreate contact to applicationId,name,class,link,xpath etcPropertytype= propertyvalueVarious kinds of commands in IDE: around 10cmds in IDE if I know those cmds then I can simply work on both IDE and RCVerify, assert, click, clickandwait,type,select,selectandwait,check,uncheck,highlight,goback,refresh,store ,echo and openSignificance of each and every cmd: with some examples:Verify and assert: to verify whether something is in webpage or not.. if the verification point is mandatory then we can go for assert if it is not mandatory then we can go for verifyVerifytextpresent,verifiytitle,verify elementpresent, verfiytext Click: we are clicking on siginibutton: inorder to perform click action we usually go for this click command means example was: clicking on a search button, or clicking on login button or to click on any link in those cases we use click command.. if there is simple click action then we can go for click cmdClickandwait: click+andwaitwhen can we use this cmd means once after we clicked on any link or button if it is redirecting to next page or the web page is reloading then we can go for clickandwait commandClickandwaitclick+waitforpagetoloadWaitforpagetoload: wait until the web page got loaded or simply stop the selenium IDE script execution until the web page got loadedGenerally for most of the applications wherever this page loading scenarios were there selenium IDE defaultly records it as clickandwait cmd…But for most of the real time application instead of loading the entire webpage some part of the page got reloaded means like a frame ro something else in such situations we can’t use clickandwait cmd directly where we need to use click cmd seperatly and waitfor cmds with separtly with the help of conext menu…Waitfor: instead of loading the entire webpage some part of the page got reloaded means like a frame ro something else in such situations we can’t use clickandwait cmd directly where we need to use click cmd seperatly and waitfor cmds with separtlyIt will stop selenium IDE script execution untilWaitfortextpresent: it will wait or stop our IDE execution until that text got displayed in the web pageWaitforelementpresent: it will wait or stop our IDE execution until that object got displayed in the web pageWaitfortitle: it will wait or stop our IDE execution until that title got displayed in the webpageWaitfortext: it will wait or stop our IDE execution until that that text wil display in web page at a specific locationHow much time IDE will wait or it wil stop the execution??? By defaultly selenium IDE will wait for 30000ms== 30sec means whenever we used waitfor or wait cmds in IDE means it wil wait for 30sec by default IDE >> goto options tab >> and click on options >> where we can see the default time sout which is 30secssFor some of the real time application the web page wil load after 30secs means assume in my application my webpage is reloading after 60secs then my script wil fail??? Simply enter the value under the optionsPause: the purpose of pause is similar to waitfor means waitfor and pause are both are one and the sameDifference b/w pause and waitfor cmds:Waitfor: by default selenium IDE will wait for 30secs if the webpage got loaded before 30secs then it will continue remaining cmds executions means it wont stop the script execution for that 30secsExample: 30sec but my app got loaded in 8secs : it wil simply execute remaning cmd executionPause: whatever time we have specified with this cmd this will stop script execution for that time means this cmd was not depending on the default time which is 30secs…..It wil stop the script execution for the specified time but it won’t consider whether the webpage got loaded or notScenario for your practise: prepare selenium IDE script for sugar CRM login krishnatrainingusa@CRM app : “/logout link” instead keeping logout as a verification point assume that I kept some text(abhi) in the web poage which is aa a verification point…We trying to excute our test case but for test case got failed??? Are we confirming that we are not logged into app???Proper verification points and waitfor cmds in SeleniumRefresh: it was similar to the reload button in an webpage means this cmd will simply refresh the current webpageRefreshandwait: it will refresh the webpage and will wait until webpage got reloadedRefreshandwait refresh+waitforpagetoloadUsage of comments in our test script:What is comment , why we are using that and what is the use of that comments??The script wont execute the commentsOnce after we added any comments to our test case it is easy to understand for anyone about that test caseHow can we add comments means???Simply place cursor wherever you want to add comments to out IDE and then select “INSERT NEW COMMENT”How to add commands in middle of test case???Simply place cursor wherever you want to add commands and simply right click and then go for “INSERT NEW COMMAND”Goback: it wil perform similar action like how the goback button is working on the web pageGobackandwait: it will move the page backward and then wil wait until the page got reloadedType: it at all we want to enter something from the keyboard we usually use type cmd or selenium IDE default use type cmd inorder to enter somevalue into any field we usually go for this type cmdSelect: inorder to select a value from the dropdown we use this select cmdSelectandwait: in most of the realtime app we can observe that pnce we select a value from the dropdown automatically the webpage will reload in such cases we usually gofor selectandwait and in remaing cases we will go for select cmdCheck: inorder to check a checkbox we go for this cmdUncheck: inorder to uncheck a checkbox we use this cmdStore: inorder to store a value in a variableInt a=56;Echo: it will print the value which we entered to this cmd into the logOpen: it will open the appOpen base url + absolute URLScenario1:Base url: url: /murthyOpen: : url: simply absolute URL it wont for for base urlCommands which contains command target and value field:Text, ?type ,(Store—comes under different category), selectText: inorder to verify a text at a particular locationCommand: verifyText,AssertText,waitfortext, storetextTarget: the object locator means where we are verifying the text simply “locator”Value: whatever text we are verifying we need to give hereType: inorder to enter something in a fieldCommand:typeTarget: we need to specify where exactly it will perform the type action means simply object locationValue: what value we were supposed to type at that locationSelect: to select a value from the dropdownCommand:selectTarget: the location of that dropdownValue: which value we want to elect from the dropdownStore: to store a value in a variableInt a=5; b=murthyCommand: storeTarget: which value we want to store (5)Value: I which variable we want to store this (a)Syntax in order to get the content present In the variable: ${variablename}Commands which contains command and target:Elementpresent, Textpresent, title,Click, check, uncheck,highlight, open,pauseElementpresent: inorder to verify whether object is there or notCommand: verifyElementPresent, assertElement Present,waitforElementPresent,storeElementPresentTarget: object locationTextpresent: inorder to verify text is there or not in th webpageCommand: verifytextpresent,assert,waitfor,storeTarget: which text we are verifyingTitle: inorder to verify the title of the webpageCommand: verifttilte,assert,waitfor,storeTarget: title of the webpageClick: or clickandwait: to click on search button/or else to perfrm some clickactionCommand: click/clickandwaitTarget:the location where we need to perform clicking actioncheck/uncheck:Command: check/uncheckTarget: object location Open: inorder to open something we are usingOpen=base URL+absolute URLCmd: openTarget:absolute URL and it is optional (“/”)Ex: murthy1234567899: inorder to stop our script execution we usually use this cmdCommand: pauseTarget: how much time we want to stop our scriptHighlight: It will hightlight the object on which it is performing the action means it is similar to that find button in IDECommands which contains only command:Refresh,goback, refreshandwait, gobackandwaitWrite a selenium IDE script to open , enter value in search filed and click on search buttonand finally verify search resultsSteps:OpenEnter some value in search filedClick on the search buttonVerify results Screenshot capturing in IDE: how we are capturing the screenshot with the help of selenium IDE . generally it order to capture any screenshot we usually press “Print screen” button on our keyboard and we used to paste that content in a paintcaptureEntirepagescreenshot: we can capture screenshots in IDEcommand: captureEntirePageScreenshottarget: where we need to save that file and with what name we need to save that file and with what extension(jpeg,png..)example: d://murthy.pngsyntax: driver://filename.extensionvalue: is optinal we no need to specify anything thereoptions in IDE:execution modes in IDE:we can execute entire test case donewe can execute single commands also: simply right click on the command and select execute this commandstart and break points in IDE: instead of executing entire test cas which contains 100 of commands how can we execute only 10 lines of code means 10cmds out of 100 commands simply with the help of start and breakpoints in IDEscenario: we need to execute from 50th to 60thlineif we set start point and break point means our execution will start from start point and will end at the break pointhow can we set a start point???Place our cursor at that 50th line and simply right click and observe whether we can see “Set/Clear start point”.. “s”How can we set a breakpoint??Simply right click on the command and select “Togle break point” “B”If we prepare a test case for and if we try to execute the same test case on how it wil work???Our testcase will fail why because Google: id property : gbqfqBing: id property: sb_form_qHow can we clear start and break points???Whenever we set a set point autoamtiocally if we start execution then the execution will be stared from that start pointHow to stop our script manually???With the help of “Pause/Resume” button we can stop our test case which is besides to “Play Current Test case “ button and by defaultly this button was in disable modeWhen it was enabled???Soon after we started exceuting our test case automatically this pause button wil be enabledHow can we use this pause button and wht is the use of this button???Once after we prepared our test cases on Test environment and whenwe are tyring to execute those test cases in production environmnet if those test cases were failed means we need to use this pause option in order to investigate the root cause behind the failureOne more button “Step by step or step button” which is besides to pause when we click on pause then only step button got enabled.Finally the usage of this step button is wherever you paused the script from tha point it will execute command wise means if I click on step at very1 st time the next cmd will execute after that if any I click on step button the next cmd wil executeLimitations of IDE and how we are overcoming thgose limitations like conditional stmts implementation, multiple window handling, alerts handling , usage of split command, generate dynamic number ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download