我正在嘗試查找動態(tài) Web 元素,因此無法通過 ID 或 Xpath 查找。我試圖找到使用“Tab”或使用另一個鍵盤命令失敗。在具有相同條件的另一個頁面上,我嘗試了以下代碼并且它有效: public void SeachApp() { WebElement elem = driver.findElement(By.xpath("//*[contains(text(),'BaseAloca')]")); int width = ((WebElement) elem).getSize().getWidth(); Actions act = new Actions(driver); act.moveToElement((WebElement) elem).moveByOffset((width/2)-2 0).click().perform(); }但是在這個新頁面上不起作用。這是頁面:HTML 代碼頁 1:<circle class="bubble" r="48" style="filter: url("https://us.qlikcloud.com/node/i-0fc3fc8cc088b4fb7/sense/app/b5573a15-e951-45b5-81ed-92ef95c916bc/datamanager/datamanager#bubble-drop-shadow"); fill: url("https://us.qlikcloud.com/node/i-0fc3fc8cc088b4fb7/sense/app/b5573a15-e951-45b5-81ed-92ef95c916bc/datamanager/datamanager#bubble-fill");"></circle><text class="label" y="5" text-anchor="middle">BaseAloca</text>我可以點擊另一個頁面:你能幫助我嗎?
添加回答
舉報
0/150
提交
取消