Chrome中的测试失败并显示错误:失败:找不到使用的元素。在Firefox中工作正常。
describe("Main page functionality", () => {
var mainPage;
var url = "https://prom.ua/ua/";
var request = 'iphone';
beforeEach(() => {
browser.ignoreSynchronization = true;
browser.get(url);
mainPage = require("../pages/mainPage.js");
});
it("Test search response title has requsted text", () => {
var mainPage = require("../pages/mainPage.js");
mainPage.search(request);
expect(mainPage.getResponseTitle().getText()).toContain(request);
});
});
答案 0 :(得分:0)
首先检查哪个元素失败,然后您可以添加等待元素可见:
browser.wait(EC.visibilityOf(element(by.id("id"))), 30000, "Element is not visible").