http://quicktesthp.blogspot.com

QTP VBScript new series + Interview Question Bank on QTP for enrichment of Knowledge in QTP

This Site has been brought to you by HP Certified Expert of QTP.

Exciting new articles for October:

1) QTP Tip:Deselect all Radio Buttons

2) HP QTP Crypt Object

3)Adding Hyperlinks in Excel Spreadsheet

Best of Luck Friends ! ! !

Expert QTP
expert.qtp@gmail.com

All Articles are Copyright Protected. These are Free for Reading & Personal Use. Reproduction in Any Form without the Permission is Illegal & Strictly Prohibited.

Copyright © 2009 ExpertQTP

Google Search

Tuesday, October 7, 2008

Usage of &_ in QTP Script

We use &_ to separate multiple lines inside our script whom we want to execute as a single command by clubbing together. Lets see the below mentioned example to make the point more clearer.


As you must have observed above, the character “&” is used to concatenate the strings while the character “_” is used to concatenate multiple lines. So on combining these two characters ie “&_” we are instructing QTP to concatenate strings spanning across multiple lines.

We could have wrote the “f.Write…………” in single line but it would have been very hard to read.

A more simple example to illustrate the usage can be:

Browser(“QTP”).Page(“QTP”). WebEdit("TextField").Set “Expert”&_
"loves QTP" &_
"Any Doubts?"

Keywords: QTP

No comments:

 
Copyright © 2009 ExpertQTP