using protractor mouseMove to click on a drop-down - protractor

I am using the following to get protractor to click on a drop-down menu.
ptor.actions().mouseMove(
ptor.findElement(protractor.By.xpath("//a[#tooltip='Portfolios']"))
).click();
However this does nothing which is to say that the drop-down does not get clicked and no errors are displayed.
What am I missing here ?

For the benefit of those who landed on this page. The solution is to use .perform at the end.
here is the working version
ptor.actions().mouseMove(
ptor.findElement(protractor.By.xpath("//a[#tooltip='Portfolios']"))
).click().perform();

Actually you don't have to use actions, with actions you can not select option that is not currently visible in the screen.
use this:
element(by.xpath("//a[#tooltip='Portfolios']")).click();

I suppose you should only use perform, like:
ptor.actions().mouseMove(
ptor.findElement(protractor.By.xpath("//a[#tooltip='Portfolios']"))
).perform();

Related

How do I add a button to 'accounts/context' through ‘vscode Plugin API’?

I am going to develop a plugin to add one or more buttons in the above position.
Based on the documentation I found, my 'package.json' looks like this:
After running F5, it did not achieve the desired effect. Who has such experience?

Remove 'Details' button from ProgressMonitorJobsDialog JFace

I am trying to remove the 'Details' button from the following ProgressMonitorJobsDialog:
I am running a org.eclipse.core.runtime.jobs.Job that opens the default Dialog. I have seen examples here of disabling the Cancel button, but I need to remove the third one and extending the default ProgressMonitorJobsDialog won't help, since it is invoked by the default UIJob class. Any ideas?
This dialog is usually ProgressMonitorFocusJobDialog displayed by ProgressManager. It isn't really possible to change the dialog without using internal APIs.
Instead of a Job you could use an IRunnableWithProgress and use ProgressMonitorDialog to run it. This dialog does not have the Details section.

GWT open.window on top window

I am using GWT in my projects, when I use the open.window the window opens in the back not in the front. I can find nothing to fix this. I've tried something called the z-index, but there is next to no documentation about this. And it didn't work.
Set focus on a new window. Probably via some kind of JSNI method which will contain something like this $wnd.focus().

Protractor - does anybody know how to click on element with RIGHT MOUSE BUTTON?

I know that protractor click on element by default with left mouse button. How to do it to click with RIGHT MOUSE BUTTON ?
el.click('RIGHT'); ?
I would have done like this:
browser.actions().mouseMove(el.find()).perform();
browser.actions().click(protractor.Button.RIGHT).perform();
Based on what I saw in actionsequence.js and Protractor rightClick issue #280
The accepted solution for this question isn't the best way to go about this. Browser actions' .click() method accepts an optional arg for clicking the right button. A better solution, from the webdriverJs api is:
browser.actions()
.click($('.myElm'), protractor.Button.RIGHT)
.perform();
Try this:
el.sendKeys(protractor.Key.RIGHT)
Here is the list of keys:
https://code.google.com/p/selenium/source/browse/javascript/webdriver/key.js
If it doesn't work do this:
https://groups.google.com/forum/#!topic/selenium-users/fF_Hcp40KO0
Let me know if it works

avoid chrome popup extension to close

Is there a function that allow me to select text when the extension
stays open. Normally when I Use the extension popup and I Click outside the
extension the extension close. Is there a wat to avoid this.
Thank you so much
Unfortunately there is currently no way to keep the popup open once you focus out of it. This is by design.
If you would like to always show something while interacting with the page, perhaps the experimental Info bars or even Desktop Notifications would work?
Hope that helped!
The only way to keep it open is to right click over the extension icon (button) and select "Inspect popup" the extension popup then show up and remain open but of course the debugger window show and this not a fix obviously still it will maybe inspire a hack... if someone is skilled enough and share the solution with all of us.
I encountered the same problem and I've thought of a possible solution (though not tested it):
Use your background.html to store the content of the popup action and upon loading the popup, you fetch the content via the default messaging for chrome extensions.
When doing all kinds of other stuff, like XHR's or something, I think you should do that in background.html too, so the requests won't abort if you close and you can do something with the result. Then when a user re-opens the popup, he'll see the result of his previous action instead of the default screen.
Anyone tried something like did already?
As far as I know you can't persist a pop up menu but my workaround has been using a content script to append a menu on page load. After the menu is appended you can toggle the menu via messaging between the background script and the content script.
If you want to encapsulate the menu from the page it's deployed on you could wrap your menu in an iframe. This could add complexity to your project since you would have to deal with cross origin issues and permissions.
There is an alternative hack for this. You can make use of chrome local storage to store the metadata as needed. Upon restart you can read that metadata and render the desired content. You will also probably clear that metadata after you have completed performing the operations based on that.