My code is designed to log into the beta version of mediawiki, navigate to the Preferences page, and attempt to click on a button located at the bottom of the page.
In order to achieve this, I am utilizing the scroll() function because using only .click()
results in an error, much like the one described below. However, I have encountered an issue where .scroll()
does not produce the desired effect.
The version of WebdriverIO being used for this project is version 4.
Approaches I've taken:
I initially attempted the test with just
elem.click()
, without any scrolling, which led to an error message stating that the element was not clickable.Running the code without
elem.click()
caused the test to pass, but there was no visible scrolling on the page (To verify, I addedbrowser.pause(9000);
at the end).When experimenting with
.scroll()
and providing values such aselem.scroll(0,500)
, the page did scroll down, but not sufficiently to view the intended element.I also tested
.moveToObject()
, which resulted in some scrolling on the page but still not enough to interact with the element. Passing values to this function did not yield successful results either.
it('should demonstrate the scroll command on the Preferences Page ', function () {
// login
browser.url('https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Special:UserLogin&returnto=Main+Page');
var loginName = $('#wpName1');
var loginPass = $('#wpPassword1');
var loginBtn = $('#wpLoginAttempt');
loginName.setValue('Ephemeraltest');
loginPass.setValue('vagrant123');
loginBtn.click();
// click button at bottom of preferences page
browser.url('https://en.wikipedia.beta.wmflabs.org/wiki/Special:Preferences');
var elem = $('#ooui-php-41');
elem.scroll();
elem.click();
});
Upon running the code, the following error is displayed:
unknown error: Element ... is not clickable at point (602, 571). Another element would receive the click: ... running chrome Error: An unknown server-side error occurred while processing the command. at elementIdClick("0.7032716938931156-1") - click.js:20:22