Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Christian Gerdes
/
WebServicePlugins
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
12
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
4b79a30c
...
4b79a30c8e0b93e5dd4bbee3df54ef3ac36d49c1
authored
2018-02-08 17:23:15 +0100
by
Christian Gerdes
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added PassIfNotFound to XPathExtractionRule
1 parent
f255d578
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
WebTestWebServiceRuntime/XPathExtractionRule.cs
WebTestWebServiceRuntime/XPathExtractionRule.cs
View file @
4b79a30
...
...
@@ -52,6 +52,11 @@ namespace WebTest.WebService.Plugin.Runtime
set
{
randomMatch
=
value
;
}
}
[
DisplayName
(
"Pass if not found"
)]
[
Description
(
"If set to true, this rule will pass the request even if no match is found."
)]
[
DefaultValue
(
false
)]
public
bool
passIfNotFound
{
get
;
set
;
}
/// <summary>
/// The Extract method. The parameter e contains the Web test context.
/// </summary>
...
...
@@ -62,11 +67,7 @@ namespace WebTest.WebService.Plugin.Runtime
try
{
ContentHandler
contentHandler
=
ContentHandlerFactory
.
GetHandler
(
e
.
Response
.
ContentType
);
if
(
contentHandler
==
null
)
{
return
;
}
if
(
contentHandler
!=
null
)
{
if
(
contentHandler
.
IsBinary
)
{
contentHandler
.
MessageBytes
=
e
.
Response
.
BodyBytes
;
...
...
@@ -114,12 +115,14 @@ namespace WebTest.WebService.Plugin.Runtime
return
;
}
}
}
catch
(
Exception
ex
)
{
e
.
Message
=
ex
.
Message
;
}
e
.
Success
=
false
;
e
.
Success
=
passIfNotFound
;
e
.
Message
+=
" (XPath not found)"
;
return
;
}
}
...
...
Please
register
or
sign in
to post a comment