小编Akh*_*esh的帖子

无法使用节点js访问Desktop Application中的窗口关闭功能

我正在使用node.js和backbone.js开发一个Windows桌面应用程序.我想在用户通过单击标题栏上的关闭按钮或右键单击Windows任务栏中的应用程序来关闭应用程序时执行操作.

我的app.js看起来像这样,

 var app = module.exports = require('appjs');


app.serveFilesFrom(__dirname + '/content/assets/');

var menubar = app.createMenu([ {
label : '&File',
submenu : [ {
    label : 'E&xit',
    action : function() {
        window.close();
    }
},{
    label : 'New',
    action : function() {
        window.test();
    }
} ]
}, {
label : '&Window',
submenu : [ {
    label : 'Fullscreen',
    action : function(item) {
        window.frame.fullscreen();
        console.log(item.label + " called.");
    }
}, {
    label : 'Minimize',
    action : function() {
            console.log("df");
        window.frame.minimize();
    }
}, { …
Run Code Online (Sandbox Code Playgroud)

javascript jquery desktop-application node.js backbone.js

15
推荐指数
1
解决办法
1672
查看次数

Selenium自动化不适用于弹出窗口

我正在使用Selenium 2.x WebDriver来实现java项目的自动化.当自动化进行时,它到达一个页面,当点击提交按钮时,出现"弹出窗口"并且不能进行自动化.

public void writeSite(WebDriver driver, ZoneTest zone) throws BiffException, InterruptedException, IOException

    //Creates a new zone for testing

    General.elementClick_xpath(driver, Locators.siteMenuDropBoxXpath);
    General.waitToLoad(General.WAIT_MIN);
    General.elementClick_xpath(driver, Locators.viewSitesButtonXpath);
    General.elementClick_xpath(driver, Locators.viewDataPointDetailsXpath);
    General.waitToLoad(General.WAIT_AVG);

    General.elementClick_xpath(driver, Locators.addZoneXpath);

    General.waitToLoad(General.WAIT_AVG);

    General.inputTextFieldEnter_Id(driver, "name", zone.zoneName);
    General.inputTextFieldEnter_Id(driver, "description",zone.zoneDescription );
    General.inputTextFieldEnter_Id(driver, "urlExtension", zone.urlExtension);
    General.inputTextFieldEnter_Id(driver, "timeSpentThreshold", zone.thresholdTime);
    General.inputTextFieldEnter_Id(driver, "tuningNumber", zone.tuningNumber);

   **General.elementClick_xpath(driver, Locators.createZoneSubmitXpath);**

   //Here a new pop up window apppears. And the following codes 3 lines doesnt work.

    General.inputTextFieldEnter_Id(driver, "active", zone.act);
    General.inputTextFieldEnter_Id(driver, "userid", zone.uid);
    General.elementClick_xpath(driver, Locators.SubmitXpath)
}


public class General 
{
  public static final long …
Run Code Online (Sandbox Code Playgroud)

java selenium-webdriver

5
推荐指数
1
解决办法
2617
查看次数