Selenium WebElement.click() vs. Javascript click event

前端 未结 2 1049
攒了一身酷
攒了一身酷 2020-12-10 05:57

I was wondering what the differences are between calling the click() method of the WebElement versus finding the element by id and firing the click

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-10 06:34

    Those kind of tests are E2E (end to end) not BDD.

    First one – is executed now, to take next action you must write some function that will delay execution for e.g download new data from server.

    The second code return promise – http://selenium.googlecode.com/git/docs/api/javascript/class_webdriver_WebElement.html – „Schedules a command to click on this element.” – you can use then callback to run next action.

提交回复
热议问题