Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18539 Posts in 4847 Topics- by 32743 Members - Latest Member: watty
 

AdvancedQTP forums have been nominated as a finalist in ATI’s 2nd annual automation honors awards!

We’d like to thank you for your continued support and participation, and urge you to hurry and vote.

Make you voice count! 


Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: Unable to use regexp for Width in DP    (Read 125 times)
hari sreekanth
Full User
***
Offline Offline

Posts: 233


Trying to become an advanced user


WWW
« on: July 15, 2010, 08:59:04 AM »

Hi,
I am trying to find out the objects which are of zero width. so the regexp i am using is :
Set obj = description.Create
obj("width").value = "[^1-9].*"
Set  objs = Browser("Google").Page("Google").ChildObjects(obj)

Is there anything wrong with my code? (please no work around suggestions)
Regards,

Logged

Tarun Lalwani
Advanced User
*****
Offline Offline

Posts: 894



WWW
« Reply #1 on: July 15, 2010, 09:03:15 AM »

The problem is that not all properties support regular expression. x,y,width, height, abs_x and abs_y. None of these properties can be used with regular expression
Logged

Tarun Lalwani,
QuickTest Professional Unplugged - My new Book on QTP...
hari sreekanth
Full User
***
Offline Offline

Posts: 233


Trying to become an advanced user


WWW
« Reply #2 on: July 15, 2010, 09:22:29 AM »

Thanks. Any idea why these were not included? And this may be out of this topic but Does qtp retrieve elements with all kinds of tags when using child objects. I have some elements with tag "LI" which i am not able to retrieve?

Regards,
Logged

Tarun Lalwani
Advanced User
*****
Offline Offline

Posts: 894



WWW
« Reply #3 on: July 15, 2010, 09:27:27 AM »

What is the description have you used?

The reason I see this limitation it would difficult and a time consuming task filter objects based on their co-ordinates and that too based on a pattern
Logged

Tarun Lalwani,
QuickTest Professional Unplugged - My new Book on QTP...
hari sreekanth
Full User
***
Offline Offline

Posts: 233


Trying to become an advanced user


WWW
« Reply #4 on: July 15, 2010, 09:32:28 AM »

This is the code i use, and there is no delay in script(or hanging) as we normally observe if there are huge no of objects. The script runs fast. So i thought may be it will retrieve only elements with particular tags

Set obj = description.Create
obj("html tag").value = "LI"
'obj("html tag").RegularExpression = False
Set  objs = Browser("Google").Page("Google").WebTable("Credit").ChildObjects(obj)

Regards,
Logged

Tarun Lalwani
Advanced User
*****
Offline Offline

Posts: 894



WWW
« Reply #5 on: July 15, 2010, 09:34:10 AM »

Use this

Set obj = description.Create
obj("html tag").value = "LI"
obj("micclass").value = "WebElement"
Logged

Tarun Lalwani,
QuickTest Professional Unplugged - My new Book on QTP...
hari sreekanth
Full User
***
Offline Offline

Posts: 233


Trying to become an advanced user


WWW
« Reply #6 on: July 15, 2010, 09:40:23 AM »

Wow , It really works. But why is it working?
Regards,
Logged

Tarun Lalwani
Advanced User
*****
Offline Offline

Posts: 894



WWW
« Reply #7 on: July 15, 2010, 09:41:03 AM »

In case of WebElement it is better to specify the micclass
Logged

Tarun Lalwani,
QuickTest Professional Unplugged - My new Book on QTP...
hari sreekanth
Full User
***
Offline Offline

Posts: 233


Trying to become an advanced user


WWW
« Reply #8 on: July 15, 2010, 11:00:05 PM »

Thanks. Its working.
Logged

Pages: [1]   Go Up
Print
Jump to: