首页 \ 问答 \ 使用XPath Extractor时如何忽略JMeter中有关html标记的错误(How to ignore errors about html tags in JMeter when using XPath Extractor)

使用XPath Extractor时如何忽略JMeter中有关html标记的错误(How to ignore errors about html tags in JMeter when using XPath Extractor)

我成功地在我的JMeter测试中添加了一个XPath Extractor。 现在,我在JMeter.log中收到错误,抱怨我们的一个网页的2个html标签。 这些标签由我们创建,是我们可以在代码中使用的标签。 但是,JMeter并不喜欢他们。 有什么地方我可以输入这些标签让JMeter知道排除检查它们。

我们说这些标签是:

xxxxx和xxxxx

这是JMeter日志信息:

2014/01/29 14:27:18 WARN - jmeter.util.XPathUtil:整洁错误:第25行第4列 - 错误:无法识别! 第255行第18列 - 错误:无法识别! InputStream:给出的Doctype是“”InputStream:文档内容看起来像HTML 4.01 Transitional 33警告,发现了2个错误! 在使用HTML Tidy生成整理版本之前,必须修复此文档。

如果我在测试中禁用XPath Extractor,我就不会再出现这些错误。 所以,我知道XPath Extractor带来了这个。 但是,我需要XPath Extractor来获取运行测试所需的其他一些信息。 所以,我无法删除它。 我有什么想法可以忽略这2个新错误?

之前我使用过HTML Assertion,并为其他项目将Error Threshhold设置为2。 但是,这似乎没有帮助。

*编辑:另外,我在XPath Extractor的“XML解析选项”中选中了“Use Tidy”。


I successfully added an XPath Extractor to my JMeter test. Now, I am receiving errors in the JMeter.log complaining about 2 of the html tags for one of our web pages. These tags are created by us and are tags that are ok for us to use in our code. But, JMeter does not like them. Is there somewhere that I can enter these tags to let JMeter know to exclude checking them.

Let's say the tags were:

xxxxx and xxxxx

Here is the JMeter log info:

2014/01/29 14:27:18 WARN - jmeter.util.XPathUtil: Tidy errors: line 25 column 4 - Error: is not recognized! line 255 column 18 - Error: is not recognized! InputStream: Doctype given is "" InputStream: Document content looks like HTML 4.01 Transitional 33 warnings, 2 errors were found! This document has errors that must be fixed before using HTML Tidy to generate a tidied up version.

If I disable the XPath Extractor in my test, I no longer get these errors. So, I know the XPath Extractor brought this on. But, I need the XPath Extractor in order to get some other information necessary to run the test. So, I cannot remove that. Any ideas how I can ignore these 2 new errors?

I have used an HTML Assertion before and set the Error Threshhold to 2 for a different project. But, that did not seem to help here.

*Edit: Also, I checked "Use Tidy" for the "XML Parsing Options" on the XPath Extractor.


原文:https://stackoverflow.com/questions/21441006
更新时间:2021-12-04 18:12

最满意答案

不属于新对象的最后10个字节会发生什么。

什么都没有。 Placement-new不接触它。 它不知道该内存块中是否还存在其他东西。 您可以轻松地为2个bar对象分配大小,在后10个字节中构造一个bar对象,然后在前10个字节中构造另一个bar对象。 想想如果placement-new做了一些事情来超越你提供的内存地址的边界会发生什么,它会破坏内存后半部分的标准。 不好。 所以它不会这样做。

放置新分区只需要所需的内存量,在这种情况下是10bytes吗?

是。 Placement-new只需调用bar构造函数,将指定的内存地址作为初始化构造函数的起始地址传递给它。 构造函数只会初始化它所需的内存部分。 由于bar类是10个字节,因此可以初始化不超过10个字节。 剩余的10个字节不受影响。

或者指针只是携带额外的10个字节,直到它被解除分配。

如果分配20个字节并在前10个字节中构造一个bar ,则剩余的10个字节将简单地存在于内存中的bar对象之后,但不是bar对象本身的一部分。 你可以用这10个字节做任何你想做的事。

另一种情况,让我说我首先开始为类吧分配内存,这是10个字节。 然后我将放置新的类foo,即20个字节。 编译器会分配更多内存吗?

No. Placement-new只是在您提供的内存地址构造指定的类。 您有责任确保内存足够大以容纳正在构建的类。

或者我必须确保事先分配足够的内存?

是。


What happens to the last 10 bytes that is not part of the new object.

Nothing at all. Placement-new does not touch it. It would not know if something else already existed in that block of memory. You could easily allocate size for 2 bar objects, construct a bar object in the second 10 bytes, then construct another bar object in the first 10 bytes. Think of what would happen if placement-new did something to overstep the bounds of the memory address you provide and it corrupted the bar in the second half of the memory. Not good. So it doesn't do that.

Does placement new partition only the amount of memory required, which is in this case 10bytes?

Yes. Placement-new would simply call the bar constructor, passing it the specified memory address as the starting address for the constructor to initialize. The constructor would initialize only the portion of the memory it needs. Since the bar class is 10 bytes, no more than 10 bytes can be initialized. The remaining 10 bytes are untouched.

Or does the pointer just carry around the extra 10 bytes until it is deallocated.

If you allocate 20 bytes and construct a bar in the first 10 bytes, the remaining 10 bytes would simply exist after the bar object in memory, but not be part of the bar object itself. You can do whatever you want with those 10 bytes.

And another case, lets say I've first started of by allocating memory for class bar, which is 10 bytes. I'll then placement new class foo, which is 20 bytes. Will the compiler allocate more memory?

No. Placement-new simply constructs the specified class at the memory address you provide. It is your responsibility to ensure that memory is large enough to hold the class being constructed.

Or do I have to make sure to allocate enough memory beforehand?

Yes.

相关问答

更多
  • 不属于新对象的最后10个字节会发生什么。 什么都没有。 Placement-new不接触它。 它不知道该内存块中是否还存在其他东西。 您可以轻松地为2个bar对象分配大小,在后10个字节中构造一个bar对象,然后在前10个字节中构造另一个bar对象。 想想如果placement-new做了一些事情来超越你提供的内存地址的边界会发生什么,它会破坏内存后半部分的标准。 不好。 所以它不会这样做。 放置新分区只需要所需的内存量,在这种情况下是10bytes吗? 是。 Placement-new只需调用bar构造函 ...
  • 没有任何东西使得所显示的代码片段固有地UB。 但是,几乎可以肯定,UB会在任何正常使用情况下立即执行。 从[basic.life] / 8 (重点矿) 如果在对象的生命周期结束之后并且在重新使用或释放对象占用的存储之前,在原始对象占据的存储位置处创建新对象,指向原始对象的指针,引用引用原始对象,或者原始对象的名称将自动引用新对象,并且一旦新对象的生命周期开始,可用于操纵新对象,如果: 新对象的存储区恰好覆盖原始对象占用的存储位置,以及 新对象与原始对象的类型相同(忽略顶级cv限定符),并且 原始对象的类型不 ...
  • 大多数人使用CSS媒体查询来响应设计,我们可以在javascript中做同样的事情。 //detect devicen width if(screen.width < somevalue){ }else if(screen.width > somevalue){ } 与媒体查询等效的device-width 或者,如果您更喜欢使用可见宽度 //detect visible width if(document.documentElement.clientWidth < somevalue){ }els ...
  • 您发布的代码具有未定义的行为,在构造函数运行之前使用了一个new贴图。 这意味着在MyClass的构造函数运行之前你指的是MyClass::m_BaseAddress ,所以static_cast是谎言并且程序无效。 标准明确说明这是3.8.5对象生存期 (强调我的)中未定义的行为。 在对象的生命周期开始之前,但是在对象将占用的存储之后,或者在对象的生命周期结束之后,在对象占用的存储被重用或释放之前,任何指向存储的指针之前可以使用对象将位于或位于的位置,但仅限于有限的方式。 对于正在建造或销毁的物体,见12 ...
  • 我过去所做的是使用char数组和我需要存储的所有类型的联合。 好处是缓冲区将正确对齐。 就像是: class MyClass { public: union { char buffer[1]; ClassA a; ClassB b; }; MyClass() {} ~MyClass() {} }; 请注意,您可以将char buffer[1]和new new放在union的类成员 ...
  • 您可以使用sizeof运算符: int a_size = sizeof(A); You can use the sizeof operator: int a_size = sizeof(A);
  • T *_new_data = (T*)new char[sizeof(T)*2*capacity]; for(int i = 0; i < size(); i++) { new (_new_data + i) T(_data[i]); } 另请参阅C ++ placement new T *_new_data = (T*)new char[sizeof(T)*2*capacity]; for(int i = 0; i < size(); i++) { new (_new_data + ...
  • 您无法调整::operator new分配的内存大小。 你唯一能做的就是使用::operator delete删除它,然后分配新的内存。 PS:关于术语的一些注释: ::operator new不是新的展示位置。 使用语法new(ptr) class(arguments)调用Placement new,并用于调用构造函数来初始化尚未初始化的内存(例如::operator new分配的内存)。 ::operator new简称为operator new。 指针的大小是指用于存储指针本身的字节数(通常在32位平 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)