Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I know that Cursor is positioned in a particular field or not
#1
Solved: 11 Years, 4 Months ago
Hello All,

I have to test an application where the requirement is as follows:

I have some fields(WebEdit, WebList etc.) and a Submit button in a Submit Report page. Here few fields are mandatory. Means if I leave a mandatory filed blank and click on the Submit button, a window pops up with some warning message. When I click on the OK button in the PopUp Window, cursor is positioned in that mandatory field and this process goes on untill I fill all the mandatory fields up.

Now I want to check this for all mandatory fields. (To validate whether Mandatory option works or not)

Suggest regarding how this can be done........
Reply
#2
Solved: 11 Years, 4 Months ago
You can get a property from that field, do a spy on that filed and see if you have a unique one and then you can get the value from that field with a GetTOProperty
Reply
#3
Solved: 11 Years, 4 Months ago
I had asked how to know whether the cursor is positioned in a particular field or not. So there is no property specified from which u can know it.

@You can get a property from that field : This meant what. Any Property will do ? Smile

@GetTOProperty: This is nowhere related,it should be GetROProperty
Reply
#4
Solved: 11 Years, 4 Months ago
For example: if you get the title of the field and then if not what expected then it would fail
Reply
#5
Solved: 11 Years, 4 Months ago
get 'focus' property using GetROProperty method. returns '1' if object has focus else '0'.

for example if you have to verify a mandatory fields (say "Name") gets focus or not after the warning message. you can use somethine like

Code:
chkFocus =  Browser(" ").Page(" ").WebEdit("Name").GetROProperty("focus")

similarly you can check this for all mandatory fields.
let me know if this helps.

Reply
#6
Solved: 11 Years, 4 Months ago
Thanks a lot Saket. It really solved my purpose.

I want to ask you a question. I used to think that we can only get the properties of any object by GetROProperty() method, which are shown under the Identification Properties when that Object is spied. But there is no "focus" property under Identification Properties. But still we can get that.

That being said, Are there any more properties which are not shown in "Object Spy" window under Identification Properties option, but still their value can be retrieved. If yes then can u please enlist few.
Reply
#7
Solved: 11 Years, 4 Months ago
basically, you can get all the runtime properties as well using GetROProperty as name suggest RO - runtime objects for objects depending on object type
its not possible for me list out the properties now, but I will definitely try to prepare one for you.

Reply
#8
Solved: 11 Years, 4 Months ago
Thank you Saket.....
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  getting the value from the field learning 0 1,046 03-19-2019, 09:13 AM
Last Post: learning
  Regarding Debug cursor option sumit_sehgal21 4 3,453 04-17-2013, 03:37 PM
Last Post: sumit_sehgal21
  Password field kumar19041980 0 2,776 09-05-2012, 03:33 PM
Last Post: kumar19041980
  How to explicitly focus the cursor sudhirzpatil 4 5,166 02-12-2009, 12:30 PM
Last Post: sudhirzpatil

Forum Jump:


Users browsing this thread: 2 Guest(s)