10-12-2013, 02:14 PM
(This post was last modified: 10-14-2013, 10:58 AM by nistalaramesh.)
In my web Application all controls are prefixed as below example:
ctl00$ContentPlaceHolder1$txtAssetNumber
ctl00$ContentPlaceHolder1$txtAssetDesc
ctl00$ContentPlaceHolder1$txtRefAssetNumber
This is a .Net web Application
I am using HP UFT11.5.
Qtp Identifying all text boxes like "ctl00$ContentPlaceHolder1$txtAssetNumber" and even for dropdowns, Radio Buttons, Checkboxes the prefix "ctl00$ContentPlaceHolder1$" comes in place.
The Prefix changes from page to page if the same text box present in different pages.
In Coding developer named the text box as "txtAssetNumber" But runtime the name changes dynamically as above mentioned.
But txtAssetNumber is the actual field name.
Attaching the view source of the page.
How can i proceed scripting using OR in QTP ??
ctl00$ContentPlaceHolder1$txtAssetNumber
ctl00$ContentPlaceHolder1$txtAssetDesc
ctl00$ContentPlaceHolder1$txtRefAssetNumber
This is a .Net web Application
I am using HP UFT11.5.
Qtp Identifying all text boxes like "ctl00$ContentPlaceHolder1$txtAssetNumber" and even for dropdowns, Radio Buttons, Checkboxes the prefix "ctl00$ContentPlaceHolder1$" comes in place.
The Prefix changes from page to page if the same text box present in different pages.
In Coding developer named the text box as "txtAssetNumber" But runtime the name changes dynamically as above mentioned.
But txtAssetNumber is the actual field name.
Attaching the view source of the page.
Code:
<div class="middlemain">
<div class="middleleft">
<span id="ctl00_ContentPlaceHolder1_lblAssetNumber_Desc">Asset Number/Desc</span>
:<span class="mandetory">*</span>
</div>
<div class="middleRight">
<input name="ctl00$ContentPlaceHolder1$txtAssetNumber" type="text" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$txtAssetNumber\',\'\')', 0)" onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="ctl00_ContentPlaceHolder1_txtAssetNumber" disabled="disabled" tabindex="1" class="textField" style="width:65px;" />
<input name="ctl00$ContentPlaceHolder1$txtAssetDesc" type="text" maxlength="32" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$txtAssetDesc\',\'\')', 0)" onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="ctl00_ContentPlaceHolder1_txtAssetDesc" tabindex="1" class="textField" style="width:230px;" />
<span id="ctl00_ContentPlaceHolder1_RequiredFieldValidator2" style="color:Red;display:none;">*</span>
How can i proceed scripting using OR in QTP ??