Javascript code for "save as template" in Thunderbird? - xul

I'm trying to create my own custom buttons in Thunderbird. I am trying to make a "Save as Template" stand-alone button. I've gotten the chrome directory completed but I cannot figure out what the command is in the button.js file. Any help is appreciated.

You need to associate the command "cmd_saveAsTemplate" with your toolbar button.
For tasks like this one, I recommoned DOM Inspector which lets you dive into the a window's XUL structure.

Related

why can't i open the design page of this project

I want to open the design page so that i can see what it looks like but i dont know how to help
enter image description here.
When i right click on the form.vb there is no view designer option and i dont want to look at the designer tab because there is no GUI on it
sorry for being bad i just couldnt find the answer anywhere else
In the Solution Explorer, the fourth button on the toolbar is a drop-down. Click it and select the item that is not currently checked. That should switch you from folder view to project view. You should then be able to open your form in the designer by double-clicking it.

Can I make popup screen or file upload automatically with selenium?

Good morning. I have a web page control with selenium. However, when I click the button of the site, a pop-up screen appears and I want to test that the file attachment is saved by pressing the file attachment button in it. Can you control selenium with two windows (parent, child-popup) going up and down?
I guess you want to interact with file upload dialog which is native window via selenium. That is not possible. However you can select file to upload using sendKeys without the dialog being opened.
Something like that
fileInput.sendKeys("/path/to/local/file");

Visual Basic - download from WebBrowser

I'm pretty new to visual basic, but have been looking far and wide and have had no luck finding an answer to this anywhere. I've used WebBrowser to navigate to a webpage. On this page there's a link to click which will then download a csv file.
I've got my program to click this link using:
WebBrowser1.Document.GetElementById("elementID").InvokeMember("click")
But I'm not sure how to handle the 'file download' dialog box that pops up. One way, I'm thinking, is to use sendkeys to click the 'save' button, but this seems a bit clunky.
I'm wondering if I can use FileDownload somehow to handle this box before it pops up. (Microsoft's documentation says: "If a file download dialog box can be displayed, this event fires prior to the appearance of the dialog box.")
Any know if this is possible or do you have any other smart ideas for solving this problem?

Selenium Upload a file using button type and button tag instead of file

I have a webpage where I click on a button and an open dialog it's opened and I should select the file to upload. After that, a pop up is displayed saying OK or KO.
I'm able to upload files when the there are files types. But in this case, the element where I click it's:
<
button type="button" read-file="_.partial(submitLang, selectedLang)" id="import-lang" class="btn btn-default"><
/button>
For the rest of the application, I use this and it works:
WebElement element = getPage().findElementById(id);
element.sendKeys(absoluteFile);
But for button types and button tag it doesn't work.
How can I do it? The tests are running on a Linux machine
Thanks a lot!
More info!!
Hi all,
The whole process is: (see image at http://imageshack.com/a/img540/6237/JoTQng.png)
Click on Import button
A dialog is opened and I select a .json file and click Open
An alert is displayed saying "Text properties have been updated".
We are using angular for the frontend and all are REST calls.
We don't have any "file=type". All three are buttons. You can found more code at
http://imageshack.com/a/img633/7299/BQhP7o.png
For a file upload with selenium, you need to find an input tag with the type "file".
Have a look at your HTML and search for it.
When you found it, the rest is pretty straightforward:
Let's say this input-element has id="import"
driver.findElement(By.id("import")).sendKeys(absoluteFile);
If you run into problems, please post more of your HTML, then I can have a look at it.
In my case, clicking on the button made an element appear in the HTML code, I assume due to javascript.
I clicked on the element (which both opens a file upload window and adds the to the HTML), and immediately after send the keys to the input element.
This creates the problem of having to close the newly opened file upload window, however this is not a problem when using --headless mode on google chrome.
I do not have a solution to close this window if you are not in headless mode for your chosen browser.

How to create popup dialog page in eclipse plugin development

I am creating an eclipse plugin for my project. I want to have a popup dialog page when the user clicks a customized icon on the toolbar, kind of like Google App Engine popup dialog, any ideas how to do it?
You need
a command
a handler for the command
a menu contribution for your toolbar
a dialog
I have constructed a (very) small example that illustrates this...