Clicking at coordinates without identifying element

前端 未结 14 1903
醉酒成梦
醉酒成梦 2020-11-28 07:49

As part of my Selenium test for a login function, I would like to click a button by identifying its coordinates and instructing Selenium to click at those coordinates. This

14条回答
  •  粉色の甜心
    2020-11-28 07:59

    If you can see the source code of page, its always the best option to refer to the button by its id or NAME attribute. For example you have button "Login" looking like this:

     
    

    In that case is best way to do

    selenium.click(id="login");
    

    Just out of the curiosity - isnt that HTTP basic authentification? In that case maybe look at this: http://code.google.com/p/selenium/issues/detail?id=34

提交回复
热议问题