Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Visible attribute
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Can someone tell me which is the better statement?

Code:
If Browser("Wisdom").Page("Wisdom IA").Frame("parent").Link("name:="& ReportName, "Visible:=True", "abs_x:="& absX, "abs_y:="& absY).Exist(0) Then

or should I use:
Code:
If Browser("Wisdom").Page("Wisdom IA").Frame("parent").Link("name:="& ReportName, "Visible:=True", "abs_x:="& absX, "abs_y:="& absY).GetROProperty("visible") Then

and what the +/- for each statements?

Not sure how to better proceed.

thx
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
the below statement might thro tun time error if the object is not found in the application...(lets say position of the link is changed)

Code:
"If Browser("Wisdom").Page("Wisdom IA").Frame("parent").Link("name:="& ReportName, "Visible:=True", "abs_x:="& absX, "abs_y:="& absY).GetROProperty("visible") Then"

so..check if the obj is present before doing anything..

Code:
"If Browser("Wisdom").Page("Wisdom IA").Frame("parent").Link("name:="& ReportName, "Visible:=True", "abs_x:="& absX, "abs_y:="& absY).Exist(0) Then"

even if it seems to be an extra check, i feel it s a good practice..

once this is true...then you can do ur validation...
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thx vIns!

So the GetROProperty could cause a run time error if the object is not found. Thx! I am using the code "If Browser("Wisdom").Page("Wisdom IA").Frame("parent").Link("name:="& ReportName, "Visible:=True", "abs_x:="& absX, "abs_y:="& absY).Exist(0) Then" but durring my research I noticed people using the GetROProperty and wasnt sure of why.

thx again
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi Lorena, I think i have confused u...
What i tried to say is, it s better to use Exist method on top of GetROProperty to avoid runtime error. Because u use coordinates which i will not use. I feel there is a chance for 'object not found' error.

Exist -- it will just say if the object is present or not.
even if the object is present, any of the property might not be as u expected. so in that case, u need to use GetROProperty to verify the property values.

Say,
There is a textbox. Lets assume it's logical name is 'Text'

WebEdit("Text").Exist --> will say it is true (or false it is not thr)
But that box might be disabled.
U might want to check if it is editable or not..in that case u need to use GetRoProperty to check if it is editable or not.
Exist method can not be used.

Hope it helps...if not, let me know with ur qn..


Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
vIns,

Thx for respondoing.

The reason I am using the abs_x and abs_y is because there is more than one link with the same name. If I do not use the abs coordinates I get run time errors.

How can I "use Exist method on top of GetROProperty"? I can only use one (Exist) or the other (GetROProperty).

I think i finally see the difference in the two functions with your reply. Thx again fgor taking the time to respond. ;-)

Have a great weekend.
Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi Lorena,

If you are having more num of links with the same name, you can go for index property. I think tht will be better instead of coordinates.

Hope that will solve your problem, if you need more clarification please welcome
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Exist and Visible Are True When Objects Aren't There - Is there A Better Way? zunebuggy 3 3,147 04-24-2018, 02:12 PM
Last Post: Ankur
  [UFT] [WPF] DataGrid: check if vertical and horizontal scrollbars are visible robertosalemi 0 2,413 07-13-2016, 06:33 PM
Last Post: robertosalemi
  Intermitent "Object not visible" error erodpr 5 3,524 01-14-2016, 10:55 AM
Last Post: vinod123
  Object properties are not visible suresh.tata 1 2,624 02-23-2014, 03:58 PM
Last Post: supputuri
Exclamation OBJECT NOT VISIBLE ERROR bala 2 4,225 07-26-2013, 03:12 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)