Answer the question
In order to leave comments, you need to log in
Protractor angular js (testing). How to click on an element that only appears on hover?
Good day.
Please tell me how you can click on an element (button), which appears only when you hover over it with the mouse cursor.
My Protractor code:
First I set variables with selectors:
var ButtonEditBanner = element(by.xpath(".//*[@id='slider']/ul/li[1]/a"));
var SaveBanner = element(by.xpath(".//*[@id='saveCovver']"));
var UploudImage = element(by.id('imageLoader'));
var WindowBanner = element(by.xpath(".//*[@id='bannerwrapper']/img"));
Then the execution itself:
it ('opens page', function() {
WindowBanner.click();
ButtonEditBanner.click();
var fileToUpload = '/Users/sergey/Desktop/wallpapers/12511H.jpg', absolutePath = path.resolve(__dirname, fileToUpload);
browser.wait(10000);
UploudImage.sendKeys(absolutePath);
SaveBanner.click();
browser.driver.sleep(3000);
});
but the execution does not even start because the bud is hidden until you hover over it with the mouse.
Help, I'm sure there are many experienced fighters.
Answer the question
In order to leave comments, you need to log in
Perhaps it will help you
ptor.actions().
mouseMove(ptor.findElement(protractor.B.id('foo'))).
perform();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question