![]() |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
![]() |
|
![]() ![]() |
Author | Message | |||||||||||||||||
tanushree
Senior Member ![]() Joined: 04Apr2007 Online Status: Offline Posts: 2160 |
![]() ![]() ![]() Posted: 28Sep2007 at 11:45pm |
|||||||||||||||||
Q: For new users, how to use WinRunner to test software applications automately ? A: The following steps may be of help to you when automating tests
If you continue going through this loop you will gradually become more familiar with WR and TSL, in fact you will probably find that eventually you do very little capture/replay and more straight TSL coding.
Q: How to use WinRunne to check whether the record was updated or the record was delelte or the record was inserted or not? Using WinRunner check point features: Create->dDB checkpoint->Runtime Record check
Q: How to use WinRunner to test the login screen A: When you enter wrong id or password, you will get Dialog box. 1. Record this Dialog box
Q: After clicking on "login" button, they opens other windows of the web application, how to check that page is opened or not When your expecting "Window1" to come up after clicking on Login... Capture the window in the GUI Map. No two windows in an web based Q: Winrunner testscript for checking all the links at a time location = 0; set_window("YourWindow",5); while(obj_exists((link = "{class: object,MSW_class: html_text_link,location: " & location & "}"))== E_OK) { obj_highlight(link); web_obj_get_info(link,"name",name); web_link_valid(link,valid); if(valid) tl_step("Check web link",PASS,"Web link \"" & name & "\" is valid."); else tl_step("Check web link",FAIL,"Web link \"" & name & "\" is not valid."); location++; }
Q: How to get the resolution settings Use get_screen_res(x,y) to get the screen resolution in WR7.5. or Use get_resolution (Vert_Pix_int, Horz_Pix_int, Frequency_int) in WR7.01
Q: WITHOUT the GUI map, use the phy desc directly.... It's easy, just take the description straight out of the GUI map squigglies and all, put it into a variable (or pass it as a string) and use that in place of the object name. button_press ( "btn_OK" ); becomes button_press ( "{class: push_button, label: OK}" );
Q: What are the three modes of running the scripts?
WinRunner provides three modes in which to run tests: Verify, Debug,
and Update. You use each mode during a different phase of the testing
process.
Q: How do you handle unexpected events and errors?
WinRunner uses exception handling to detect an unexpected event when it occurs and act to recover the test run.
Q: How do you handle pop-up exceptions? A pop-up exception Handler handles the pop-up messages that come up
during the execution of the script in the AUT. TO handle this type of
exception we make WinRunner learn the window and also specify a handler
to the exception. It could be
Q: How do you handle TSL exceptions? Suppose you are running a batch test on an unstable version of your
application. If your application crashes, you want WinRunner to recover
test execution. A TSL exception can instruct WinRunner to recover test
execution by exiting the current test, restarting the application, and
continuing with the next test in the batch. Q: How to write an email address validation script in TSL? public function IsValidEMAIL(in strText)
Q: How to have winrunner insert yesterdays date into a field in the application? 1) Use get-time to get the PC system time in seconds since 01/01/1970 Q: How can withwin runner to make single scripts which supports multiple languages?
Actually, you can have scripts that run for different locales.I have a set of
scripts that run for Japanese as well as English Locales. Idea is to have
objects recorded in GUI Map with a locale independent physical description.
This can be achieved in two ways.
After taking care of different GUIs for different locales, the script also needs some modification. If you are scripting in English and then moving on to any other language (say Japanese), all the user inputs will be in English. Due to this the script will fail as it is expecting a Japanese input for a JPN language. Instead of using like that, assign all the user inputs to a variable and use the same wherever the script uses it. This variables has to be assigned (may be after the driver script) before you call the script which you want to run. You should have different variable scripts for different languages. Depending on the language you want to run, call the appropriate variable script file. This will help you to run the same script with different locale
Q: How to use a regular _expression in the physical description of a window in the GUI map? Several web page windows with similar html names - they all end in or contain "| MyCompany" The GUI Map has saved the following physical description for one of these windows: { class: window, html_name: "Dynamic Name | MyCompany" MSW_class: html_frame } The "Dynamic Name " part of the html name changes with the different pages. Replace: { class: window, html_name: "!.*| MyCompany" MSW_class: html_frame } Regular expressions in GUI maps always begin with "!".
Q: How to force WR to learn the sub-items on a menu...?
If WR is not learning sub-items then the easy way id to add manually
those sub items in to GUI map.. of course you need to study the menu
description and always add the PARENT menu name for that particular sub-menu.. Q: How to check property of specific Icon is highlighted or not? set_window("Name of the window");
Q: BitMap or GUI Checkpoints DO NOT use BitMap or GUI Checkpoints for dynamic verification. These checkpoints are purely for static verifications. There are ofcourse, work-arounds, but mostly not worth the effort.
Q: How to to get the information from the status bar without doing any activity/click on the hyperlink? You can use the "statusbar_get_text("Status Bar",0,text);" function
Q: Object name Changing dynamically? 1. Q: Text Field Validations Need to validate text fields against 1. Null 2. Not Null. 3. whether it allows any Special Characters. 4. whether it allows numeric contents. 5. Maximum length of the field etc. 1) From the requirements find out what the behaviour of the text field in question should be. Things you need to know are : what should happen if field left blank what special characters are allowed is it an alpha, nemeric or alphanumeric field etc.etc. 2) Write manual tests for doing what you want. This will create a structure to form the basis of your WR tests. 3) now create your WR scripts. I suggest that you use data driven tests and use Excel spreadsheets for your inputs instead of having user input. For example the following structure will test whether the text field will accept special characters : open the data table for each value in the data table get value insert value into text field attempt to use the value inserted if result is as expected report pass else report fail next value in data table in this case the data table will contain all the special charcatersQ: Loads multiple giumaps into an array #GUIMAPS------------------------------------------------------------------- Q: How to break infinite loop set_window("Browser Main Window",1); text=""; start = get_time(); while(text!="Done") { statusbar_get_text("Status Bar",0,text); now = get_time(); if ( (now-start) == 60 ) # Specify no of seconds after which u want break { break; } }
Q: User-defined function that would write to the Print-log as well as write to a file function writeLog(in strMessage){ file_open("C:\FilePath\..."); file_printf(strMessage); printf(strMessage); }Q: How to do text matching? You could try embedding it in an if statement. If/when it fails use a tl_step statement to indicate passage and then do a texit to leave the test. Another idea would be to use win_get_text or web_frame_get_text to capture the text of the object and the do a comparison (using the match function) to determine it's existance.
Q: the MSW_id value sometimes changes, rendering the GUI map useless
MSW_Id's will continue to change as long as your developers are modifying your
application. Having dealt with this, I determined that each MSW_Id shifted by
the same amount and I was able to modify the entries in the gui map rather
easily and continue testing.
Q: Having the DB Check point, its able to show the current values in form but its not showing the values that saved in the table This looks like its happening because the data has Database Testing
Q:How do you find an object in an GUI map?
The GUI Map Editor is been provided with a Find and Show Buttons.
Q:What different actions are performed by find and show button? To find a particular object in the GUI Map file in the application,
select the object and click the Show window. This blinks the selected
object.
Q:How do you identify which files are loaded in the GUI map? The GUI Map Editor has a drop down GUI File displaying all the GUI Map files loaded into the memory.
Q:How do you modify the logical name or the physical description of the objects in GUI map? You can modify the logical name or the physical description of an object in a GUI map file using the GUI Map Editor.
Q:When do you feel you need to modify the logical name? Changing the logical name of an object is useful when the assigned logical name is not sufficiently descriptive or is too long.
Q:When it is appropriate to change physical description? Changing the physical description is necessary when the property value of an object changes.
Q:How WinRunner handles varying window labels? We can handle varying window labels using regular expressions.
WinRunner uses two hidden properties in order to use regular expression
in an object’s physical description. These properties are regexp_label
and regexp_MSW_class.
Q:What is the purpose of regexp_label property and regexp_MSW_class property? The regexp_label property is used for windows only. It operates
behind the scenes to insert a regular expression into a window’s label
description.
Q:How do you suppress a regular expression? We can suppress the regular expression of a window by replacing the regexp_label property with label property. Post Resume: Click here to Upload your Resume & Apply for Jobs |
||||||||||||||||||
![]() |
||||||||||||||||||
![]() ![]() |
||
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
© Vyom Technosoft Pvt. Ltd. All Rights Reserved.