I want to hover over a element and later click on it.
Below is the code
await browser.actions().mouseMove(elm, { x: 200, y: 200 }).perform();
await browser.wait(EC.visibilityOF(elm2),10000);
await elm2.click();
I also tried without the offset, like for instance:
await browser.actions().mouseMove(elm).click().perform();
However , I could not get the hover effect and click on the element I wanted , i.e elm2 in this case.
My protractor version is 5.4.1
Appreciate your assistance.
Thanks
I have found the routines in protractor-test-helper extremely useful and robust. These (and instructions for use and installation) can be found at github.com/hetznercloud/protractor-test-helper
So in your case you would say something like:
import { click, hover} from '#hetznercloud/protractor-test-helper/dist';
and later
await hover(elm, 10000); //hover over item, waiting up to 10 seconds
await click(elm2, 10000, 3); //waits for elm2 to show up, up to 10 seconds, clicks on it, 3 retries
But if you just want to look at their hover implementation code for inspiration (not all that different from yours without the offset and with the structure of the three beginning lines), it is at line 55 of https://github.com/hetznercloud/protractor-test-helper/blob/master/dist/actions.js
I know this doesn't tell you exactly how to change what you have, but I hope it gives you at least one (or two) ways to move forward.
Related
I try lots of things but I failed kindly help me with how to do this and please someone shares a complete. I also share a screenshot of the original app I making same like this app.
App description:
1:When typing or calculating on the app if the user needs the next line and show a list num
2: The most important thing is when we calculate any num can we write something in the same type ( you think it's a notepad + calculator)?
3: Also when we write and type 5 + 5 we don't need to press = equal to. they abstract and subtract automatically.
thank you so much for your support.
Good day,
I have a map with markers that move every 3 seconds to a new location, using ReactLeafletDriftMarker. I cannot, unfortunately, share my code since it is confidential.
My issue is that the markers do not drift, they just jump/appear in the next location.
Does anyone know what causes this to happen?
I can share this snippet:
{Object.entries(latlng).map(([key, value]) => {
return (
<ReactLeafletDriftMarker
position={value}
duration={4000}
keepAtCenter={false}
icon={markerIcon}
>
</ReactLeafletDriftMarker>
);
})}
It shows how (around) 400 points move on a map.
All help is appreciated, thanks.
It was a simple mistake. I assigned a key to the container, so it re-rendered every time the markers changed position values.
Using this basic example code from microbit, blinking heart, I tried to change the delay of blinking with the pause argument. However, the minimum actual blinking frequency is around 500ms, no matter what value i put.
Do you know why, and how I can achieve much faster blinking with led patterns (like show_icon or show_leds function).
def on_forever():
basic.show_icon(IconNames.HEART)
basic.pause(50)
basic.show_icon(IconNames.SMALL_HEART)
basic.pause(50)
basic.forever(on_forever)
Thanks.
You have tagged this as micropython but I don't believe that is what you are using. I think you are running with the Python in the MakeCode editor.
Looking at the help page for for the MakeCode show_icon, it says it is called with:
def basic.show_icon(icon: IconNames, interval: null): None
with the following details about interval:
interval (optional), the time to display in milliseconds. default is
600.
As you were not putting a value for interval it was defaulting to 600 milliseconds which meant your code was putting 650 milliseconds delay between each icon.
I was able to vary the duration an icon was displayed with the following:
def on_forever():
basic.show_icon(IconNames.HEART, 100)
basic.show_icon(IconNames.SMALL_HEART, 400)
basic.show_icon(IconNames.HEART, 100)
basic.show_icon(IconNames.SMALL_HEART, 800)
basic.forever(on_forever)
i'm using this on push button click in Qt:
QString fileName = QFileDialog::getSaveFileName(this, tr("Save file"),
QString(),
tr("(*.csv));
it take 3-4 second to open the save Form. why? how i can improve speed?
Try to connect this slot to a QPushButton:
void MainWindow::openFD(){
QTime myopentime=QTime::currentTime();
for (int i=0;i<1000000;i++) ;//comment out this line for the real test
QString fileName = QFileDialog::getSaveFileName(this,QString(),QString(myopentime.toString("m.s.zzz")+" "+QTime::currentTime().toString("m.s.zzz"))
,tr("*.csv") );
}
Then try to run it with and without the count part.
You will see, that the count part adds some ms... without it there is not even ms (mili-second) of difference in the time shown in filename place.
So, you have to search somewhere else in your code or give us a better example.
PS:
1) You will need :
#include <QTime>
2) The line that counting is there to show you that my method works (since you will see some difference when uncomment)
Result and Answer: The problem is not on QFileDialog if this test will not give you differences but somewhere else in your code or possibly in the Window manager of your OS.
I did some research into this and couldn't really find anything, so if this is a repetitive question I apologize. but anyway I have made a CCB file in CocosBuilder and I would like to start the timeline, for example, at one second instead of playing from the beginning. Is there a way to do this? Thanks for the help guys.
Edit: i would like this to be done in the code.
I am using 2.2.1 Cocos2DX version. I think there is no option to play it from given interval. But you can tweak yourself to get it done. (Not simple one)
You have to go to CCBAnimationManager and there you get "mNodeSequences".
It is dictionary and you get difference properties there like "rotation position etc..."
values there.
Internally AnimationManager reads this value (These values are specified in your CCB)
and puts in runAction queue.
So you have to break it as you want.(Ex. 5 min timeline you have. But you want to start
from 1 min then you have run first 1 min Actions without delay and for remaining you
have properly calculate tween intervals.
It's long procedure and needs calculation. If you don't know any other simpler way try this. If you know pls let us know (Post it).