control visible or not : Object Identification and Technologies

control visible or not

Technology specific object identification, supported applications, web technologies, and 3rd party controls.

control visible or not

Postby rohitjain3333 » Tue Jul 10, 2012 11:44 am

Hi,

We want to write a function which will take argument as ranorx path or any element and it will show that the element is visible or not. If the control is visible then it will return true else it will wait for 60 secs and will again check the element visibility and will return false. we are not getting how to send the element as argument to a function. Every time the element will be different.

Please help :roll: :cry:

Thank You in Advance
rohitjain3333
 
Posts: 20
Joined: Tue Sep 20, 2011 8:12 am

Re: control visible or not

Postby Support Team » Wed Jul 11, 2012 2:53 pm

Hi,

Do you want to create a method which gets an element as argument and checks if that element is visible?
Which elements do you want to send to the function?
Did you try to define the argument as Adapter or Element?
Did you know that you can also add the visible attribute to the used RxPath, like "yourElement[... and @visible='true']"?

Regards,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 6860
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: control visible or not

Postby sham526 » Thu Jul 12, 2012 7:32 am

First the argument must be declared as ranorex.unknown type instead of Ranorex.Table or something like that
and the function can be
Public Function FnElement_Visibility_Check(rxpath as Ranorex.Unknown) As Boolean
************
****************
End Function
sham526
 
Posts: 37
Joined: Wed Jul 07, 2010 8:12 am
Location: Hyderabad(INDIA)

Re: control visible or not

Postby Support Team » Thu Jul 12, 2012 4:58 pm

Hi,

I would say Adapter is more suitable for the argument.
Here is my suggestion ;):
Form form = "/form[@title='Calculator']";
        Button button = "/form[@title='Calculator']/titlebar/button[@accessiblename='Close']";
        checkVisibility(form);
        checkVisibility(button);
}
        
        
public void checkVisibility(Ranorex.Adapter adap){
        	
        Report.Info(adap.Visible.ToString());
}

Thanks for posting your method!

Regards,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 6860
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: control visible or not

Postby dman » Thu Sep 20, 2012 11:19 am

annoying that the Visible attribute is not properly delivered - the elements I'm checking are not visible at all, yet the Spy "sais" they are and hence I get "nice" false negatives

not to mention that using the Adapter approach (your example) does not work in my case as I work with generic Ranorex.Core.Element objects and can't quite make the conversion

any idea how I can get the real Visible attribute value?

All the best,
D.
dman
 
Posts: 52
Joined: Mon Aug 29, 2011 10:33 am
Location: München

Re: control visible or not

Postby Support Team » Thu Sep 20, 2012 6:07 pm

Hi,

In order to analyze the issue we would need a Ranorex snapshot file of the specific element.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files

Thanks,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 6860
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: control visible or not

Postby dman » Fri Sep 21, 2012 10:34 am

Hi Markus,

As background, the element is contained on the login page of the AUT which (as it should) is not visible anymore after login - but I still get all the elements as visible.

Please find attached the snapshot of the element (container with all login elements). It is taken after login - hence when it should be recognized as invisible.

All the best,
D.
Attachments
LoginPageElements.rxsnp
Login page elements (snapshot after login)
(330.42 KiB) Downloaded 38 times
dman
 
Posts: 52
Joined: Mon Aug 29, 2011 10:33 am
Location: München

Re: control visible or not

Postby Support Team » Fri Sep 21, 2012 6:18 pm

Hello,

Thank you for the Snapshot file.
It seems that the loginForm still exists at this time. Can you please send us a snapshot file from the whole application? We will look into this issue and get back to you as soon as possible.

Regards,
Bernhard
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 6860
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: control visible or not

Postby dman » Mon Sep 24, 2012 10:01 am

Hi Bernhard,

True, the form still exists but after login is not visible anymore.
I'll send you the snapshot via e-mail (I'll include a link to this post).

All the best.
D.
dman
 
Posts: 52
Joined: Mon Aug 29, 2011 10:33 am
Location: München

Re: control visible or not

Postby Support Team » Mon Sep 24, 2012 3:06 pm

Hi,

Thanks for the snapshot!
Is the "Visible" attribute of that element "/dom[@caption='RTT PictureBook']//div[#'flashContainer']/flexobject/container/container/element[@id='loginStage']" always false or just when the login page is hidden?
If it is not always false you can use this element in order to check if the login page is visible or not.

Regards,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 6860
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: control visible or not

Postby dman » Mon Sep 24, 2012 5:15 pm

ha, you have a good eye :) that is part of a workaround I've asked dev to implement (yes I can use it); but my problem is that from now on I will not be able to trust Ranorex's results 100% anymore, as I would expect that a hidden element is also reported as hidden/not visible :(

All the best,
D.
dman
 
Posts: 52
Joined: Mon Aug 29, 2011 10:33 am
Location: München

Re: control visible or not

Postby Support Team » Wed Sep 26, 2012 4:13 pm

Hi,

Thanks ;).

We are doing our best to determine if an element is visible or not but for some special controls it is not always possible as they seem to be visible and it is also often returned that they are visible although they are not shown.

Regards,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 6860
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Object Identification and Technologies

Who is online

Users browsing this forum: No registered users and 0 guests

cron