Forum Discussion

Clear_Capital__'s avatar
Clear_Capital__
Contributor
12 years ago

populating incorrect namespace is Xpath assertion

I have a REST URI , something like

https://testserver.mycompanydomain.com/v1/employee/

its used to pull employee information , by passing employee id

https://testserver.mycompanydomain.com/ ... yee/123456

When I trying to create Xpath Assersion, its declaring namespace like this

declare namespace ns1='https://testserver.mycompanydomain.com/v1/employee/345678';
//ns1:Response[1]/ns1:employeeID[1]

where 345678 is the employee id passed in the most recent request. So the name space become dynamic, and the Xpath assertion when trying to use this assertion for a different employee id

instead, name space should be declared as (without the hardcoded employee id value)

declare namespace ns1='https://testserver.mycompanydomain.com/v1/employee/';
//ns1:Response[1]/ns1:employeeID[1]

Please advise on what could be wrong and possible solutions.

Thank you

2 Replies

  • Hello,

    Is it possible for you to send me your project file? I would really like to look at the set up to check why it is taking the id as part of the namespace. Thanks.

    Regards,
    Temil
  • nmrao's avatar
    nmrao
    Community Hero
    This is just a side note. I believe that the service seemed to be designed/implemented that way, it would help talking to developer/service provider and explain the issue occuring during the tests.