|
5#
楼主 |
发表于 2010-1-19 11:24:19
|
只看该作者
Questions:
1. Are you using a Debugger? (ie. IE Developer ToolBar, Debugbar,
Firebug, etc..) If not, I would suggest installing one of them first,
because it will help you identify extra attributes available for an
object that QTP Spy sometimes just does not provide enough
information.
2. Are you familiar with DOM and all of its objects, methods, events,
etc..? If not, I would suggest looking at some quick tutorials on
this, because this will help you to access objects again that seem
hard to access via QTP.
3. Also, what was used to create the web application you are trying to
test? This is key, because the today's creation of web applications
has expanded past your normal HTML, VB, etc. There are various forms
of creating web applications that can hinder to normal automation of a
regular web application when it comes to record and replay for
automation (which I do not suggest). For instance, GWT and GWT - EXT,
is a prime example where record and replay using QTP does not work.
GWT's rendering of names, id's, etc.. can change as more widgets of
its kind are added. Therefore, if you do not understand ways how to
get under the hood of an object, you can find yourself stuck. This is
where the DOM understanding and the right debugger can save time and
enable you to create strong, reusable automation architectures.
4. Do you use Descriptive Programming for QTP? If so, then I may have
a library that can help you. If not, then I would suggest spending
time understanding this concept with QTP.
Suggestions:
1. There are various elements that I have ran across that look like
drop down boxes but the rendered HTML shows that it is a combo box
made up of different objects. Therefore, you could have a regular
weblist, which many times QTP can recognize, or you could have a
webEdit field attached to a image that resembles a arrow that makes up
the drop down list. There are many ways to handle this. I am going to
go through the ways below:
a.) If you are using Object Repositories, I recommend first trying to
add the object individually to the OR. Click within the WebEdit type
piece first and then add the arrow piece. You may realize that these
are two different objects. If it is, then you can use a click method
on the WebEdit piece to serve as activating the drop down list to
display. And then you may realize that even the component that is used
to create the list, is a different type object. Many times a
webElement that can be identified by its HTML tag, class name, id, or
name, and is activated by the innertext value you want to select from
the list. This is one way that may help you.
b) Also, you may want to try DOM events to activate the list.
FireEvents like onmouseover, onmouseup, onkeypress, etc... to see if
this will help you activate the drop down so that you can click from
the list. |
|