QTP Tips and Tricks - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: General (https://www.learnqtp.com/forums/Forum-General) +--- Forum: Suggestions and Feedback (https://www.learnqtp.com/forums/Forum-Suggestions-and-Feedback) +--- Thread: QTP Tips and Tricks (/Thread-QTP-Tips-and-Tricks) |
RE: QTP Tips and Tricks - gaveyom - 08-29-2011 Hi Rajpes, you said in above comment that it would be not good to use for best practice the Systemutil.Run SystemUtil.Run "www.google.com" can u provide/ tell me then which is the best practice (07-26-2011, 03:24 PM)rajpes Wrote: SystemUtil.Run "www.google.com" Hi Rajpes, you said in above comment that it would be not good to use for best practice the Systemutil.Run SystemUtil.Run "www.google.com" can u provide/ tell me then which is the best practice @gaveyom - rajpes - 09-21-2011 I did not mean that SystemUtil.Run is not good practice, i don't think any other alternative for this. i meant directly writing web url (by omitting 'iexplore' )may not be good practice Initializing a counter in Do loop - rajpes - 09-21-2011 no need to initialize a counter to zero before entering into a do loop do until some condition is true c=c+1 'you don't have to specify c=0 before this do loop, numerics are assigned 0 by default if not initialized loop worksheets or sheets - rajpes - 09-22-2011 while working with excel sheets, save time by writing "sheets" in place of "worksheets" , both do same task ComboBox items into array - rajpes - 09-23-2011 If there is need to get all items of combobox to an array,QTP provides a method "GetContent" through which all items are returned as a single string. Now to separate them into an array, use split with delimiter as vblf Code: AllItems=Window("Flight Reservation").WinComboBox("Fly From:").GetContent DataTable.Import/ImportSheet - rajpes - 09-25-2011 when you want to load an externally created sheet using 1)Import:You have to make use of GetCurrentRow & SetCurrentRow methods to loop over the rows because in every iteration the whole sheet is imported freshly which resets CurrentRow to 1 everytime! where as using 2)Importsheet: the CurrentRow is unaffected by multiple imports. so you don't have to use SetCurrentRow method here Check if a webtable column is sorted - rajpes - 09-28-2011 Code: r=Browser("xyz").Page("xyz").webtable("xyz").RowCount How to retrieve test result summary without writing any script - rajpes - 09-30-2011 1. Write "regedit" under run, then go to HKEy_LOCAL_MACHINE ->Software->Mercury Interactive->Quicktest professional-> logger->Media->Log 2. Then change the value for "Active" under "Log" from 0 to 1. 3. Now execute your automation script and go to the corresponding Result folder for that script. You can see a folder named as "Log" present there. 4. Go to that "Log" folder, now you can find a html file named as "LogFile.html". Open that file, it will display whole test results and their summary. At the bottom of that LogFile html page, you can find a webelement named as "Executionassed" or "Execution Failed" depends on the status. How to know the password - rajpes - 10-11-2011 If a password is already entered in a textbox by someone which appears in the form of dots or stars,3 ways of hacking that password 1)using object spy, you can check the "value" property 2)equivalently, msgbox TextBoxObject.getroproperty("value") 3)click record , go to that password textbox, give 2 spaces in the end and 2 back spaces(to remove your characters).Now a setsecure statement would be generated in your script eg:TextBoxObject.setsecure "4e93d473e107b51e592f945561gb0263bsa70f17013dcde96ef7" Now, if you have another textbox on the page(eg:username) write this line in next line of the script WebEdit("username").setsecure "4f276558710344aa1ef240e0e53a" Now run it and see that the password appears on the username textbox RE: QTP Tips and Tricks - sshukla12 - 12-21-2011 (07-25-2011, 11:49 AM)rajpes Wrote: Let us share some tips and tricks we come across when working with QTP. Hi, Nice iniciative. The method you posted is something like Global Dictionary, where we can add values on the basis of keys. Please clariffy my doubt. Regards, Sankalp |