Micro Focus QTP (UFT) Forums
How to validate file Extension in qtp 9.2 - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: How to validate file Extension in qtp 9.2 (/Thread-How-to-validate-file-Extension-in-qtp-9-2)



How to validate file Extension in qtp 9.2 - chetan-24 - 09-27-2008

hi
Chetan here
I want to check the file extension as per my project requirement.
i want to check either file extension is .jpg or .gif.
so how can i do with reguler expression?

Let me know that if any other way to check that.


RE: How to validate file Extension in qtp 9.2 - Ankur - 09-27-2008

This post on validate files extension using QTP might help you


RE: How to validate file Extension in qtp 9.2 - kishoreinchennai - 09-30-2008

1)Get File NAme using Getroproperty
2)Use the Right Function to get the last 3 characters
3)check if it is "jpg" or "gif"
or

objRegExpr.Pattern = ".*.jpg|.*.gif"

Regards