Angularjs 如何在量角器中进行逼真的垂直和五颜六色滑动动作?
请帮助我,我不能做一个垂直和垂直滑动动作滚动 我试过了,例如垂直滑动,它不起作用:Angularjs 如何在量角器中进行逼真的垂直和五颜六色滑动动作?,angularjs,appium,Angularjs,Appium,请帮助我,我不能做一个垂直和垂直滑动动作滚动 我试过了,例如垂直滑动,它不起作用: browser.actions () .mouseDown (element (by.css ('. filter-editorial-rating .ngrs-handle-max'))) .mouseMove ({x: 0, y: 50}) // value of Y how many pixels from above are shifted when scrolling .mous
browser.actions ()
.mouseDown (element (by.css ('. filter-editorial-rating .ngrs-handle-max')))
.mouseMove ({x: 0, y: 50}) // value of Y how many pixels from above are shifted when scrolling
.mouseUp ()
.perform ();
有必要在滑动的帮助下滚动,使其看起来像人类的动作
我也试过了
browser.controlFlow (). execute (function () {
browser.executeScript ('arguments [0] .scrollIntoView ({behavior: "smooth"})',
linkfound3.getWebElement ());
});
它工作了,但只是滚动而没有触摸屏幕
顺便说一下,例如,轻敲看起来像真实的动作,例如:
browser.actions (). mouseMove (burger_link) .click (). perform ();
// it work as human
也许我应该通过browser.actions,通过点击来使用垂直滑动,但我不知道怎么做
如何在量角器中以人的动作进行逼真的一击?
请帮忙,或者至少直接说
更新:
我找到了我需要的!这是
var startLocation = {
x: 0,
y: 50
}
var newLocation = {
x: 0,
y: 1000
};
browser.touchActions()
.tapAndHold(startLocation)
.move(newLocation)
.perform();
但是muve()函数将光标移动得太快。如何调整速度?请尝试以下选项
Var bottomPageEle = locator from bottom of the page.
现在要垂直滚动,请使用java脚本执行器使用scrollIntoView
选项,如下所示
await browser.executeScript("arguments[0].scrollIntoView(true);", bottomPageEle);
await browser.sleep(3000);
上述js执行器将执行垂直滚动
希望它能帮助你它没有按我需要的方式工作,也许我需要滚动磁带,你知道怎么做吗?你是在
controlFlow中尝试的吗
我在没有controlFlow的情况下尝试的-这没有帮助。我得出的结论是,对我来说,它是使用不同速度的短期垂直滚动滚动页面,这很可能看起来像一个现实的用户操作。也许你知道怎么做?我找到了我需要的!这是var-startLocation={x:0,y:50}var-newLocation={x:0,y:1000};browser.touchActions().tapAndHold(startLocation).move(newLocation.perform();但是muve()函数将光标移动得太快。如何调整速度?