Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to distinguish objects via other properties than shown via Object Spy?
#1
Not Solved Question 
I'm recording QTP scripts in a web application that is mainly built in javascript. When clicking on a menu (dropdown style) there are eight choices in the menu, but only some of them are active (clickable) and this is based on which brand you have chosen in an earlier page of the application.

When spying at one of the choices/objects in the dropdown menu (via ObjectSpy) both when the object is clickable and not clickable there are no differences in the QTP Test Object properties and the QTP Run-Time Object properties. Therefore I'm not sure how to make my QTP script know if the menu object is clickable or not.

How can I distinguish objects except for via the object property values that are shown in Object Spy?

When looking at the webpage source code of the menu object there are differences in the values for "isPermitted" and "class" (see code below), but is there a way to pick-up this difference into my QTP script?

Object when inactive and not clickable:
Code:
<div style="pixelWidth:300" value="10:02" id="31" title="Drop-down Choice 1" isPermitted="false" typeId="1         " path="null" class='menuItemDisabled'  onclick="ShowMenu(SelectorContainer4);Do('31')" /><noBr>Drop-down Choice 1</noBr></div>


Object when active and clickable:
Code:
<div style="pixelWidth:300" value="10:02" id="31" title="Drop-down Choice 1" isPermitted="true" typeId="1         " path="null" class='menuItem'  onclick="ShowMenu(SelectorContainer4);Do('31')" /><noBr>Drop-down Choice 1</noBr></div>


(Edit changes: It should be a difference between the values for "isPermitted" in the code above and not "onclick" as I first wrote)
Reply
#2
Not Solved
Check the "disabled" property
Reply
#3
Not Solved
Thanks for the answer! The "disabled" property is not included in the object's Test Object properties (only in Run-time Object Properties) so I don't know how to check/pick it? It's not possible to pick it the same way as the Test Object Properties, when I try to get the value by using ddlink.GetROProperty("disabled"), no value is picked.

I don't know if it matters, but in my first post I forgot to mention that the choices/objects in the menu are WebElement class objects.
Reply
#4
Not Solved
Yes it matters..web element doesnt have a disabled property.

the only work around i could think is :

1)Click on menu something must happen if yes clickable nothing happenes not clikable

Since i dont your application i am not sure whether goingback after clicking is possible.

If you come across a better solution please let us know

regards
Reply
#5
Not Solved
Thanks again, kishore!

I will start working on the work-around you suggested, but if someone else know a way to see if a WebElement object is active/clickable or not, I would appreciate the information.
Reply
#6
Not Solved
Hi, MGMN
Can you attach screenshot of ObjectSpy window with properties and screenshot of this menu. I want to know how it looks like, maybe I will have solution for your problem
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Collecting Objects And Object State At Runtime zunebuggy 3 1,725 11-22-2017, 02:37 PM
Last Post: supputuri
  object spy not recognizing object.. pleaseeeee help Sonia Sadeque 3 3,453 12-22-2016, 02:42 PM
Last Post: ishan.mahajan@adp.com
  Row count is always shown as 1 Harry1999 0 2,093 04-14-2016, 11:11 PM
Last Post: Harry1999
  verify that parent properties match object currently displayed in your application. sona 0 3,137 02-21-2016, 12:00 PM
Last Post: sona
  Object Spy window is not getting hidden Neetha 2 2,960 08-28-2015, 01:27 PM
Last Post: balak89

Forum Jump:


Users browsing this thread: 1 Guest(s)