Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Not Recognizing WebElement
#1
Not Solved
Hi All,

I have a strange issue with QTP.
Scenario

I have to enter a value in a webedit and click on save button
I recorded the script and while running the script when it enters the value and goes to the next line to save it, the button is not visible
and it throwing an error object not found.
The way they coded the button is after entering the value in the webedit and click on any area that save button would vanish.
Could someone please let me know how to code this scenario.

Thanks in advance!!!
Reply
#2
Not Solved
quickest advice I can offer is try adding a micTAB to the value or rerecord and after you enter the data hit the tab key, then click save.

they probably have a javascript validation onclick event that needs to fire in order to activate the save button. Look in the QTP document as well, there is a way to trigger events, but the tab key is usually the easiest.

Hope this helps.
Reply
#3
Not Solved
I added micTab and it did not work either....
Also WebEdit does not support Type...
Is there any other way I can type letters on the webedit and make the focus stay on the Save button?

Thanks,
Sathiya
Reply
#4
Not Solved
Sathiya,

Try useing FireEvent
Code:
Browser("").Page("").WebButton("Save").FireEvent "onmouseover"

and kindly let me know this solve your problem.
Reply
#5
Not Solved
Hi Arun,

I have a WebEdit and when I run the below code the Webedit is not getting enabled, and only if I input a value on the WebEdit then the Save button would get enabled.

Code:
Browser("").Page("").WebEdit("WebEdit").Set "test3"

The below line did not work
Browser("").Page("").WebButton("Save").FireEvent "onmouseover"


Thanks,
Sathiya
Reply
#6
Not Solved
The thing is that you have to figure out what javascript event is enabling the button. It is usually onchange, or onblur for the WebEdit. It could also be onkeydown, onkeypress, or onkeyup. When you are entering the value manually, the behavior can give you a clue as to what event to fire. If the Button does not enable until you leave the field, then it is onblur. If the button becomes enabled as you type, it could be any one of the others.

If you can't inspect the code to figure it out, which would be the most accurate way of determining what event enables the button, you can fire all the events and figure it out with trial and error. Try the below code and comment out each line and run until you figure out what event enables the button.

Code:
Browser("").Page("").WebEdit("WebEdit").Set "test3"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onchange"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onblur"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onkeydown"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onkeypress"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onkeyup"

There are other events that could do it (like Sathiya pointed out, it could be an event on the WebButton like onfocus, but I doubt it). However, the event is most likely one of the above. More information: http://www.w3schools.com/jsref/dom_obj_event.asp

You can also try changing the ReplayType for the WebPackage:
Code:
Setting.WebPackage("ReplayType")=2
Browser("").Page("").WebEdit("WebEdit").Set "test3"
Setting.WebPackage("ReplayType")=1
Reply
#7
Not Solved
Hi Sathiya,

Sorry i am not yet clear with your problem...
can you please elaborate step by step...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP not recognizing the webelement vidya2k2 3 3,190 04-06-2015, 10:36 PM
Last Post: babu123
  QTP recognizing every JavaEdit as "VTextField" having different index values. K Gaurav Varshney 1 2,205 10-29-2012, 11:51 AM
Last Post: krr
  Application and QTP freezes when recognizing/selecting Java Tab pora 4 6,529 01-10-2012, 10:11 PM
Last Post: sunnyk8
  QTP Webelement with Html tag as OPTION pjr 0 6,833 01-30-2011, 05:33 AM
Last Post: pjr
  QTP WebElement Click Help Anilkr 1 8,711 02-04-2010, 01:35 PM
Last Post: sreekanth chilam

Forum Jump:


Users browsing this thread: 2 Guest(s)