Highlighted
Respected Contributor.
Respected Contributor.
396 views

Mandatory Asterisk.

Hello everyone I am newbie to uft I have to valide/verify the respective field is present and it is required field. how can i do it ny help will be welcome \

 

Thnks

0 Likes
5 Replies
Highlighted
Respected Contributor.
Respected Contributor.

Re: Mandatory Asterisk.

Hi newbieny,

Hope you are doing great!

My name is Manuel Solano from MicroFocus UFT team.

Could you please explain me what is the issue that you are facing.

Regards,

0 Likes
Highlighted
Contributor.
Contributor.

Re: Mandatory Asterisk.

Hello,

To check if it is present in the application, you can use the ".EXIST" method.

If Browser("MyBrowser").Page("MyPage").Webedit("EditField").Exist Then
    Reporter.ReportEven MicPass, "Verify field", "Expected field is displayed"
Else
    Reporter.ReportEven MicFail, "Verify field", "Expected field is NOT displayed"
End If

To check if it is required, you can check value of property "required" at runtime using ".GetRoProperty" method.

If Browser("MyBrowser").Page("MyPage").Webedit("EditField").GetRoProProperty("required") = True Then
    Reporter.ReportEven MicPass, "Verify field", "Field is mandatory"
Else
    Reporter.ReportEven MicFail, "Verify field", "Field is NOT mandatory"
End If

Hope this helps. - Vince

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Mandatory Asterisk.

Thanks for your response will try and let you know.
0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Mandatory Asterisk.

When I use the first solution in the function I don’t get any kind of response or message
0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Mandatory Asterisk.

Function verify_fields(pname)
Set wWebElement=description.create()
wWebElemenet(“html id”).value=pname
If browser(“title:=.*”).page(page).WebElement(wWebElement).Exist. Then
I have copied your solution same exact
It doesn’t show any error or anything so that’s mean it’s working?
Thanks
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.