Cypress で Gremlins.JS を使用してアプリケーションをファジングしています。カスタムグレムリンを作成するために、このコードブロックを使用しようとしています
function customGremlin() {
return function attack() {
document.getElementById("search_query_top").value = "Johnny Bravo"
};
}
そして、このように使用します:
before(() => {
return cy.visit('http://automationpractice.com/index.php').then(() =>
cy.window().then((pageWindow) => {
horde = createHorde({
window: pageWindow,
species : [customGremlin]
});
})
);
});
ただし、次のエラーが発生します。
Cannot set property 'value' of null
為にdocument.getElementById("search_query_top").value = "Johnny Bravo"
どんな助けでも大歓迎です。