c# - Assert.Fail failed. System.NotSupportedException: GetProperty of "HasFocus" is not supported on control type: Window -



c# - Assert.Fail failed. System.NotSupportedException: GetProperty of "HasFocus" is not supported on control type: Window -

i trying run coded ui test in firefox browser , getting error message:

assert.fail failed. system.notsupportedexception: getproperty of "hasfocus" not supported on command type: window

i trying run coded ui test in firefox browser , getting error message:

assert.fail failed. system.notsupportedexception: getproperty of "hasfocus" not supported on command type: window

private void newhousecalctest(action<test.web.testing.utility> testgroup) { datarow dr = testcontext.datarow; assertions assert = new assertions(testcontext); newhouseuimapclasses.loadnewhouseurlparams win = this.newhouseuimap.loadnewhouseurlparams; win.uinewhousecalculatorhowindowurl = common.getparamvalue(dr, "newhouseurl", win.uinewhousecalculatorhowindowurl); if (common.isiterationenabled(testcontext.datarow)) { using (test.web.testing.utility util = new test.web.testing.utility(testcontext, 2000, testcontext.resultsdirectory)) { // next entries set browser, either net explorer or firefox , whether or not clear cookies and/or cache if (string.isnullorempty(browserwindow.currentbrowser)) { browserwindow.currentbrowser = "internet explorer"; } browserwindow.clearcache(); browserwindow.clearcookies(); // if have test case associated test, grab info parameters // populate pagename , browserwindow of util class util.pagename = this.newhouseuimap.loadnewhouseurlparams.uinewhousecalculatorhowindowurl; util.browserwindow = this.newhouseuimap.uinewhousecalculatorhowindow; seek { util.runteststep("opennewhousecalc", "open newhouse calc home page ", () => this.newhouseuimap.loadnewhouseurl(), 5000); testgroup(util); util.closecurrentbrowser(); } grab (exception e) { assert.fail(e.tostring()); } { util.closebrowserwindows(); } } } }

[datasource("microsoft.visualstudio.testtools.datasource.testcase","http://tfs.test.com:8080/tfs/enterprise;microsoft .net", "12004", dataaccessmethod.sequential), testmethod]

// method verify if textboxes empty error message shuould visible in new house calculator.

public void newhousewithoutval() { action<test.web.testing.utility> testgroup = util => { assertions assert = new assertions(testcontext); // grabbing values test case manager dr. datarow dr = testcontext.datarow; newhouseuimapclasses.clickcalculateparams textboxval = this.newhouseuimap.clickcalculateparams; // grabbing values dr variables. textboxval.uiwagesedittext = common.getparamvalue(dr, "wages", ""); textboxval.uiinvestmentsdividendsedittext = common.getparamvalue(dr, "investments", ""); #region variable declarations htmldiv loanpageheading = this.newhouseuimap.uinewhousecalculatorhowindow.uinewhousecalculatorhodocument1.loanpageheading; htmlspan wagesmessage = this.newhouseuimap.uinewhousecalculatorhowindow.uinewhousecalculatorhodocument1.uinewhousepane.wagesmessage; htmlspan investmentmessage = this.newhouseuimap.uinewhousecalculatorhowindow.uinewhousecalculatorhodocument1.uinewhousepane.investmentmessage; #endregion // method click on "calculate" button. util.runteststep("clkcalculate", "click calculate button without value", () => this.newhouseuimap.clickcalculate(), 5000); // assertion verify header page text , empty textboxes error messages. assert.areequal("mortgage calculator - how much house can afford?", loanpageheading.innertext); assert.areequal("this field required.", wagesmessage.innertext); assert.areequal("this field required.", investmentmessage.innertext); }; newhousecalctest(testgroup); } [datasource("microsoft.visualstudio.testtools.datasource.testcase", "http://tfs.test.com:8080/tfs/enterprise;microsoft .net", "12041", dataaccessmethod.sequential), testmethod] public void newhousewithoutvalff() { browserwindow.currentbrowser = "firefox"; newhousewithoutval(); }

c# firefox coded-ui-tests notsupportedexception

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -