官术网_书友最值得收藏!

Interacting with WebElements

In the previous section, we saw how to locate WebElements on a web page by using different locator methods. Here, we will see all the different user actions that can be performed on a WebElement. Different WebElements will have different actions that can be taken on them. For example, in a textbox element, we can type in some text or clear the text that is already typed in it. Similarly, for a button, we can click on it, get the dimensions of it, and so on, but we cannot type into a button, and for a link, we cannot type into it. So, though all the actions are listed in one WebElement interface, it is the test script developer's responsibility to use the actions that are supported by the target element. In case we try to execute the wrong action on a WebElement, we don't see any exception or error thrown and we don't see any action get executed; WebDriver ignores such actions silently.

Now, let's get into each of the actions individually by looking at their Javadocs and a code example. 

主站蜘蛛池模板: 汾西县| 新野县| 鹤岗市| 周宁县| 玉门市| 泗阳县| 贵定县| 新竹市| 股票| 石林| 托克托县| 武宁县| 昌乐县| 连江县| 四子王旗| 阳曲县| 肃南| 合山市| 北流市| 荆州市| 巩留县| 宜良县| 余庆县| 河池市| 扎鲁特旗| 新竹市| 兴安县| 阿尔山市| 平塘县| 林西县| 常德市| 海伦市| 黄龙县| 拜泉县| 宜宾县| 房山区| 文成县| 扶风县| 汶上县| 洛川县| 碌曲县|