Clicking at coordinates without identifying element

前端 未结 14 1918
醉酒成梦
醉酒成梦 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 08:05

    I used AutoIt to do it.

    using AutoIt;
    AutoItX.MouseClick("LEFT",150,150,1,0);//1: click once, 0: Move instantaneous
    
    1. Pro:
      • simple
      • regardless of mouse movement
    2. Con:
      • since coordinate is screen-based, there should be some caution if the app scales.
      • the drive won't know when the app finish with clicking consequence actions. There should be a waiting period.

提交回复
热议问题