I have declare an object, which have "Text" property with value 1.
Below is the object please check
Set q_textbox = page.NativeWebObject.Find("idStr","updatedQty_0")
after further execution of my script this object value is changed in application as 4 and then i am trying to print the value in test log but it still displaying value 1 in logs.
How can make a re-check condition for this object so it will print new value in the log ?
Is your item in, say an update panel - in other words loaded by means of ajax/callback or the like ? TC may not be able to pick up on the change to the object's properties in this case. You may need to use RefreshMapping on the page object or refetch the object if this is the case. Out of interest, why don't you use NameMapping&Aliases ? Also, keep in mind, TC objects are not entirely Object Oriented model objects. You don't neccesarily store a reference to an object, so if you go fetch a TC object with .Find, you aren't exactly working on that page "Object" directly. So, the page may change, but your instance of it won't always be able to reflect the property changes unless you are explicitly doing checkproperty in which case TC is polling the page object to find out when it changes or refresh mappings etc. .
If you have access to this object in the application, why don't you do another .find search and find the same object?
You can also use "OnLogEvent" event (this is not the most elegant solution).
Hi @kaiiii ,
after finding the object for the first time, just do "Sys.Refresh()" and again try finding the object.
i guess that vll work.
Sathish Kumar K
Was the issue solved? Please share the solution with us or let us know if you need any more assistance.
Hi Can you try check my last example from this topic?
Try to translate this JS into your VB script.
> Set q_textbox = page.NativeWebObject.Find("idStr","updatedQty_0")
Knowing nothing about your tested application, this is what I would try:
-- Set a breakpoint on the line next to the .Find() call, Evaluate found q_textbox object and note the value of its q_textbox.FullName property;
-- Set another breakpoint on the line where you expect to see value of .Text to be equal to 4 and continue execution;
-- When execution stops at the second breakpoint:
-- Highlight UI element that you expect to correspond to the q_textbox object using Object Spy and check: a) if the value of the .Text property equals to 4; and b) if the value of the .FullName property equals to the previously noted one.
If values for FullName do not match, this obviously means that you work with different objects and must search for this another object before using it in test code.
If values for FullName do match, this may mean that the object was recreated somewhere between two breakpoints. Again, in this case you need to search for the same (but recreated) object before validating its value.
Generally speaking, the following workflow should be used when working with dynamic web pages: if the value of some UI object's property in test code does not correspond to your expectation but Object Spy displays correct value for the highlighted UI element, this usually means that the given UI element was recreated and must be searched for anew.