Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Not Recognizing WebElement
#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


Messages In This Thread
QTP Not Recognizing WebElement - by Sathiyakum - 01-20-2011, 10:28 PM
RE: QTP Not Recognizing WebElement - by cdesserich - 01-26-2011, 10:26 PM

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

Forum Jump:


Users browsing this thread: 2 Guest(s)