How to generate unique name?
auto t, tt, leng, i;
t = get_time();
leng = length(t);
tt = "";
for (i = 1; i <= leng; i++)
tt = tt & (sprintf("%c", 97 + i + substr(t, i, 1)) );
WinRunner: Do Java Add-Ins required for Web based Application?
We do not need any Java add-in to tests simple JSP pages. If we are using Java applets with some swing or awt components drawn on the applet then we need java add-in otherwise simple web add-in will server the purpose. Reply
WinRunner: How to work with file type using WinRunner functions?
When recording, WinRunner does not record file-type objects. However, We can manually insert file-type statements into our test script using the web_file_browse and web_file_set functions. Reply
WinRunner: What tag is required to allow me to identify a html table?
Indeed, it is better to ask developer to put ID every place where it is possible. It will avoid lots of trouble and help the resuable of our script (consider localization).Reply
How to use values returned by VB script in winrunner?
From our VB script create a file system object to write output to a text file :
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("c: estfile.txt", True)
MyFile.WriteLine("This is a test.")
Then use file_open and file_getline functions in WinRunner to read the file. Reply
How to create an Object of an Excel File in WinRunner?
The object part, or actual Excel table is created via the WinRunner Data Table and it is stored inside the same directory that the WinRunner script is stored in. Of course we may create the Excle spreadsheet themself and reference it from our script manually. This is also mentioned in the User Guide.
The Data Table Wizard mentioned earlier will link this object to the script and assist in parameterizing the data from the Excel table object. Reply
WinRunner: What is the difference between virtual object and custom object?
The virtual object is an object which is not recognized by Winrunner. The virtual object class like obj_mouse_click which works for that instance only. To work at any time, then we should forcibly to instruct the winrunner to recognize the virtual object with the help of Virtual Object Wizard.
Note : the virtual object must be mapped to a relavant standard classes only avail in winruuner. Ex : button (which is avail on the toolbar in a app. window) which is to be mapped to the standard class callled PUSH_BUTTON. when its completed then we can observe the TSL statment would be button_press("logicalName") which is permanent one in we r winrunner.
GUI map Configuration :
It helps when winrunner is not able locate the object by winruuner. for ex : two or more objects will have same logical name and its physical properties then how winrunner locate the specific object. In which case that should instruct the winrunner to unquely identify the specific object by setting obligatory, optional and MS_WID with the help of GUI Map config.
we use the virtual object wizard in winrunner to map the bitmap object while recording winrunner generates the obj_mouse_click.
Custom object is an object which do not belong to one of the standard class of winrunner. We use the gui map configuration to map the custom object to standard object of the winrunner.
virtual object : image or portion of the window are made virtual object to use functions available for the object just for convenience in scripting.
virtual object captures the cordinates of the object.
custom object : general object which does not belong to winrunner class, we map this general object to winrunner standard object, i.e. custom object.Reply
Can WinRunner put the test results in a file?
Yes, We can put the results into the file format. (the file extension is .txt) In Test Results window, We can select one option :
tools menu text report then we can get a text file.
Another option is to write out the results out into a html file.Reply
WinRunner: How to read dynamic names of html_link
Use the following steps :
> Using the Function, web_tbl_get_cell_data read the link.
> use GUI_add function to add to the Map editor.
> use GUI_save function to save the same link.
> Now, web_link_click() and pass the variable that we got in step.
Can try this method. It will reduce the complexity and there is no need to update the GUI Map File. Use web_tbl_get_cell_data() function to get the Description of the link and use the variable name in web_link_click() function.
> get number of row in your table: tbl_get_rows_count ("tableName",rows);
> write a for loop: for(i=0;i<=row;i++)
> get text of specified cell with column and row:tbl_get_cell_data ("Name","#"&i,column,var1);
> compare with the if condition
> if true : make any flage and take row number in variable m
> now end the loop and write
tbl_set_selected_cell ( "tableName", "#"& m,column);
if(var1 == Supplier)
tbl_set_selected_cell ( "Name", "#"&m,"#"&j type ("<kTab><t2><kReturn>");Reply
Is there any function in winrunner which will clear the history of the browser?
Actually the script is working fine when we execute for the first time. But when we execute in the second time it is directly going inside the application without asking for login credentials by taking the path from the browser history. So the script fails. It is working fine if I clear the history of the browser before each run.
This is not the matter of clearing the history. In any case it should not allow we to login to application with entering login credentials. I think this is application bug.
To clear history :
del "C:Documents and Settings\%USERNAME%