We have a plugin which gets user input from the WebDialog and performs operations in sketchup. There are more than 20 different screens/html forms (HTML pages) which is used for designing a solar plant using Sketchup.
The question is, we have frequent releases with new features added to the plugin and the plugin is distributed internally within the company. I want to get some level of automation in place which will allow the QA team to develop automation scripts to test the webdialog/IE user interface as well as the resulting operation. While we can validate the result of an operation using ruby scripts, I really need help in building some automation of the internal webdialog.
Selenium, Watir-webdriver etc all open a new IE browser outside the context of Sketchup. Has anyone attempted automating the IE/WebDialog inside Sketchup. I tried ruby win32ole also, but the same result.
Is there some bridge or some pointers on how to get to automate the HTML from content (preferably with Ruby). Any help is appreciated.
A Wedialog opened within SketchUp offers many basic options - location, size etc.
Its content’s HTML/URL can be changed via Ruby commands.
JS/JQuery scripts can run in the page, but they can also be initiated from the Ruby-side [with passed parameters etc], so they can change most aspects of the page’s contents, appearance etc internally, AND called from the Ruby-side…
As well as Ruby-side affecting the Webdialog, the Webdialog itself can be set up to open with skp ‘callbacks’ attached, and so with corresponding JS calls set up to be linked to fire those data can be passed back to the Ruby-side, initiating Ruby-side changes.
Those in turn can affect the page…
There are many examples of Plugins which use Webdialogs, HTML, JS etc in this way
@bradaskins - you done work with automating webdialogs?
AutoHotkey? It can use SketchUp menus to activate plugins, it can focus the webdialogs, relocate them, resize the, move the mouse, click the mouse, send keys, and so on. I think it can locate controls in the dialog using a COM library. Works on Windows only.
Windows scripting and/or powershell can do automation also such as activate windows by name and sending keys.
Another option may be to use Ruby to call win32api functions.
Another possibility might be to use IE (not SketchUp’s embeded IE) and register a custom application protocol which would send the data to a program/script of your choice. Then you could use Watir on the browser for automation.
Thanks Jim for the options. Definitely, application protocols is interesting, as i could then use watir-webdriver to automate the html forms.
Were you able to automate Sketchup using Ruby? We are trying to automate Sketchup application which we use it to design our solar panels. We are using Python for our framework. Based on the posts, I understand we can use JS to interact with icons in the dialog box. Please share your implementation if you can. Thanks, !
I just happened on this gem - looks interesting.