Tag: 声明

在尝试添加xpath断言时在groovy脚本中出错

我正在尝试执行下面的代码时遇到下面的exception: 缺less属性exception groovy脚本中的代码将xpath断言添加到testing用例中。 有没有可能的解决scheme来解决这个错误? 它的testing套件名称为“ManagePostpayInsurance_1_0”,testing步骤名称为“getInsuranceDetails_1_FTC_005”。 log.info("Testing Start") TSName = "ManagePostpayInsurance_1_0" StepName = "getInsuranceDetails_1_FTC_005" project.getTestSuiteList().each { if(it.name == TSName) { TS = it.name it.getTestCaseList().each { TC =it.name def asserting = project.getTestSuiteByName(TS).getTestCaseByName(TC).getTestStepByName(StepName).getAssertionByName("XPath Match") if (asserting instanceof com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.XPathContainsAssertion) { project.getTestSuiteByName(TS).getTestCaseByName(TC)getTestStepByName(StepName).removeAssertion(asserting) } def assertion = project.getTestSuiteByName(TS).getTestCaseByName(TC)getTestStepByName(StepName).addAssertion("XPath Match") assertion.path = "declare namespace cor='http://soa.o2.co.uk/coredata_1';\ndeclare namespace man='http://soa.o2.co.uk/managepostpayinsurancedata_1';\ndeclare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';\n" assertion.expectedContent = "200" […]

Excel中的VBA:2007年执行时出现“无法find项目或库”错误

在Excel 2003中使用VB for Excel,我没有问题执行一些非声明variables的代码: numberOfBooks = 0 但是,如果我尝试在Excel 2007中执行相同的代码,我得到一个“无法find项目或库”错误消息。 我看了工具>选项,我没有选中“需要variables声明”。 在Excel 2003中,我没有使用Option Explicit 我究竟做错了什么? 非常感谢你。

For循环中运行时错误13

出于某种原因,我得到一个'运行时13'错误,当我执行下面的代码。 Dim N_1 As Variant Worksheets("Trucks").Activate Range("G9").Activate Do Until ActiveCell.Value = "" ActiveCell.Offset(1, 0).Select If ActiveCell.Value = "" Then Exit Do Loop ActiveCell.Offset(-1, 0).Select N_1 = Range(ActiveCell, "G9") With CreateObject("scripting.dictionary") .comparemode = vbTextCompare For Each v1 In N_1 If Not IsEmpty(v1) Then If Not .exists(v1) Then .Add v1, Nothing End If Next z1 = .keys […]

在声明中作为variables名称的一部分variables? 处理图表系列

有没有办法如何在for循环中声明variables,并使用“int i”作为variables名称的一部分? 我试图在for循环中设置我的excel图表的一些调整,并且为每一行指定不同的颜色需要不同的系列:|。 我想要这样的东西: for(int i=0; i < myMaximum; i++ ) { Excel.Series series_i+1 = (Excel.Series)mychart.SeriesCollection(i+1); series_i+1.Border.Color = mycolors[i]; } 是这样的可能吗? 我需要在for循环中执行它,因为系列的数量取决于myMaximum的数量。

VBA – 如何声明“单元格”variables

为可能非常容易回答的问题道歉。 我正在通过网站上的一些代码来搜寻如何search一行并将其粘贴到另一个工作表中,代码如下所示: Sub Test() For Each Cell In Sheets(1).Range("J:J") If Cell.Value = "131125" Then matchRow = Cell.Row Rows(matchRow & ":" & matchRow).Select Selection.Copy Sheets("Sheet2").Select ActiveSheet.Rows(matchRow).Select ActiveSheet.Paste Sheets("Sheet1").Select End If Next End Sub 我想知道应该宣布什么“单元格”,如下所示: Dim Cell As … 我知道,没有“Option Explicit”,这是不相关的,但我很好奇,所以请帮忙解释一下,如果可以的话。 提前谢谢你的帮助 :)

使用断言来比较两个excel文件

我使用Visual Studio来创build一个自动testing,创build两个Excel表。 作为最后的检查,我需要比较这两个excel表格的内容,并确保它们是平等的。 有没有办法做到这一点与断言? 像Assert.AreEqual(file1, file2); ? 任何帮助或指导,将不胜感激!

Excel,Visual Basic编辑器,枚举types声明 – 未定义用户定义的types

我有以下代码,我不知道为什么Excel在Test2()子例程中看不到Enumtypes(我声明): Private Sub Test1() Dim test_name As Variant End Sub Private Enum rlcRollercoasterState rlcRollercoasterDisabled rlcRollercoasterEnabled rlcRollercoasterBroken rlcRollercoasterMissing End Enum Private Sub Test2() Dim var1 As Variant Dim rlcRC1State As rlcRollercoasterState ' User-defined type not defined End Sub 如果我在Enumtypes声明后复制Test1()子例程,Excel将识别Test1()的rlcRollercoasterStatetypes。 如果我注释掉Test1()子例程,则Excel将在Test2()识别rlcRollercoasterStatetypes。 为什么Excel无法在Test2()子例程中看到rlcRollercoasterStatetypes?

“Dim myarray()as String”VS“Dim myarray()as Variant”

我总是害怕在假设分配不必要的大量内存的情况下声明variables。 最近正在努力提高电子表格的性能,但我却得到了相反的印象(请参阅下面的编辑): Dim myarray() as Variant改善了性能,与Dim myarray() as String相比Dim myarray() as String 这两个声明的主要区别和后果是什么? 在这里找不到明确的指导: https : //msdn.microsoft.com/en-us/library/aa711948.aspx 编辑:受控性能testing 我运行了一个受控的性能testing(将dim myarray() as Variant版本,创build一个副本并将两个variables更改为Dim myarray() as String ) 正如你可以看到下面我错了,性能差异并不显着。 Dim myarray() as Variant VERSION Start 4:05:47 PM FXLoaded 4:05:47 PM 00:00 TDLoaded 4:06:38 PM 00:51 LisofPCTD 4:06:57 PM 00:19 YDLoaded 4:07:47 PM 00:50 LisofPCYD 4:08:14 PM 00:27 […]