我一直试图在弹出的selenium中单击一个按钮,但我得到了以下错误:
object [HTMLDivElement] has no size and location
我已经尝试了正常的方式,只需单击,因为它在视图中,我正在等待页面完全加载:
let pressCookieButton = await driver.findElement(By.xpath('//a[@class="btn-actiune btn-actiune--principal"]/..'))
await pressCookieButton.click();
但这行不通。上面写着
Ele
在Internet Explorer11中,我尝试使用driver.wait()来等待一个元素,然后再对它做一些操作,对于不同的元素,我会间歇性地得到以下错误:
TypeError: Cannot read property 'length' of null
at C:\tools\node_modules\selenium-webdriver\lib\webdriver.js:909:22
at ManagedPromise.invokeCallback_ (C:\tools\node_modules\selenium-webdriver\lib\promis
我已经使用Selenium做了一个UI测试,我希望能够通过cli启动它。因此,我已经安装了selenium-side-runner,并通过以下命令启动了测试:
selenium-side-runner -c "browserName=firefox" mytest.side
和超时定位项.tt-cursor li
NoSuchElementError: Unable to locate element: .tt-cursor li
at Object.throwDecodedError (../../../../../usr/local/lib/node_
我需要使用Selenium-webdriver单击页面中的链接,但无法使用href的值访问元素,如下所示:
var link = WebDriver.FindElements(By.XPath("//a[@href='example.html']"));
因为页面中的元素位于一个框架中,并且位于另一个页面的源中。因此,我需要点击一个特定的坐标,其中的链接。如何通过使用selenium来实现它。
我试图从下拉列表中获取一个元素,选择它并遍历,但我做不到。
我知道,我想从下拉列表中选择的元素的xpath是:
/html/body/div[1]/div/div[1]/div[1]/div[2]/div/div/div[1]/div[2]/div[1]/div/div/div/div[2]/div/div/ul/li[2]
当下拉窗口有id rw_2_input时
下拉列表允许您从以下五个选项中选择一个:小于18、18-40、40-60等;所以我这样做了:
// select the dropdown and click on it
const age = await driver.find
我正在努力了解如何一起使用摩卡和硒。我找到了一个简单的教程,但一开始我就得到以下错误
Google Search
1) should work
0 passing (2s)
1 failing
1) Google Search should work:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runnable.js:157:19)
at Timer.listOnTimeout [as ontimeout]
我在我的量角器测试套件中得到了错误Failed: element not interactable。
本质上,我试图单击一个复选框,但它告诉我不能这样做,因为元素没有显示在DOM上。然而,当我运行我的测试套件和Chromedriver浏览器弹出并运行模拟测试时,我可以看到我试图在屏幕上点击的元素!
下面是浏览器在运行测试时的屏幕截图。
我已经验证了元素确实存在于DOM中,具有某种expect(elementToTest.isPresent()).toBe(true)的效果,并且它通过得很好。当我执行expect(elementToTest.isDisplayed()).toBe(tr
我已经安装了npm硒驱动程序,现在我想尝试使用它。
我创建了一个js文件test.js
var webdriver = require('selenium-webdriver'),
By = require('selenium-webdriver').By,
until = require('selenium-webdriver').until;
var driver = new webdriver.Builder()
.usingServer("http://docker01.localhost:4444/wd/hub")
我在一个通过jest (实际上是ts-jest)启动的Node.js项目中使用了selenium-webdriver和chromedriver。
当我运行时:
npx jest test/integration/SetupTest.test.ts
测试运行良好。它打开Chrome并将Selenium连接到它。
测试设置如下所示:
import webdriver from 'selenium-webdriver';
let driver: webdriver.WebDriver;
const chromeOptions = new chrome.Options().addArg
我有一组测试,在那里我需要登录,然后执行搜索。我的申请是角JS,我正在起诉量角器。实际上,在收到一个新的应用程序包之前,我的测试都很好,而且我的所有测试都失败了:
element(by.id('mainGlobalSearchBtn')).sendKeys('a');
这是我的控制台输出:
1) change number of items displayed by page should display 20 items per page
Message : UnknownError: unknown error: cannot focus el