How do I handle object existence with QTP?

自古美人都是妖i 提交于 2020-01-05 09:08:44

问题


I am new to QTP and I have a problem with "error validation message". I have a task that checks whether the error validation message appears when invalid input is entered. I tried to check before and after the data is entered, but unfortunately the QTP recognies the "error message" and see is even that the error is not displayed on the page.

can I handle this issue ?


回答1:


The error message may exist even if you can't see it, especially in web applications an element is often there but invisible until it's needed.

You can check if the error message object is visible, there are three common ways in which an object can be invisible

  • It has a property marking it as invisible (e.g. in Web visible=false)
  • It has a zero width or height
  • It is located off-screen (often in a negative position)
    • Note that for multiple monitors a negative position may still be visible.

Find out how to distinguish a visible error message from an invisible one and write your test accordingly.



来源:https://stackoverflow.com/questions/9789995/how-do-i-handle-object-existence-with-qtp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!