1
點擊我有,我都想盡已知的方式點擊這裏元素有幾個:不能元素
var areaMap = $('[data-bind="click: campusMap"]');
var areaMap = browser.driver.findElement(By.cssSelector("div.campus-map.panel > div.panel-footer > button.btn.btn-browse")).click();
var areaMap = element(by.cssContainingText('button.btn', "View Area Map"));
//and this way too
browser.executeScript('arguments[0].click()', areaMap.getWebElement());
browser.actions().mouseMove(areaMap).click().perform();
我不知道如何使這個要素互動,能。
的HTML看起來像這樣:
<div class="campus-map panel" data-bind="click: campusMap">
<div class="title">Area Map</div>
<div class="panel-content">
<div id="googleContainer" style="position: relative; background-color: rgb(229, 227, 223); overflow: hidden;">
<div class="gm-style" style="position: absolute; left: 0px; top: 0px; overflow: hidden; width: 100%; height: 100%; z-index: 0;">
<div style="position: absolute; left: 0px; top: 0px; overflow: hidden; width: 100%; height: 100%; z-index: 0; cursor: pointer;">
<div style="margin-left: 5px; margin-right: 5px; z-index: 1000000; position: absolute; left: 0px; bottom: 0px;">
<div class="gmnoprint" style="z-index: 1000001; position: absolute; right: 166px; bottom: 0px; width: 121px;">
<div style="background-color: white; padding: 15px 21px; border: 1px solid rgb(171, 171, 171); font-family: Roboto,Arial,sans-serif; color: rgb(34, 34, 34); box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.2); z-index: 10000002; display: none; width: 256px; height: 118px; position: absolute; left: 36px; top: 5px;">
<div class="gmnoscreen" style="position: absolute; right: 0px; bottom: 0px;">
<div class="gmnoprint gm-style-cc" style="z-index: 1000001; position: absolute; -moz-user-select: none; right: 95px; bottom: 0px;" draggable="false">
<div class="svg-controls" style="z-index: 0; position: absolute; bottom: 13px; right: 0px;">
<div class="gm-style-cc" draggable="false" style="-moz-user-select: none; position: absolute; right: 0px; bottom: 0px;">
</div>
</div>
</div>
@Sam謝謝你的清潔:) –
你嘗試點擊ng嗎? –
@ruby我不能改變html,我不認爲這是一個角度頁面。我在頁面上有按鈕,這個只是出於任何原因不想被點擊 –