Highlighted
New Member.
3132 views

PC - Getting Error -Operation failed Error Code 1001

Jump to solution

Hi All,

I am trying to create PC scenario using the Rest API. I created the complete xml request which works perfectly fine for 1 group but when I add more groups in the xml. It throws Operation Failed error. I designed Basic/By group scenario.

Any help would be highly appreciated. 

Thanks.

0 Likes
1 Solution

Accepted Solutions
Highlighted
New Member.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

The issue was not with the test scenario name.

<WorkloadType>
<Type>basic</Type>
<SubType>by group</SubType>
</WorkloadType>
<LGDistribution>
<Type>all to each group</Type>
<Amount>4</Amount>
</LGDistribution>
<Groups>
<Group>
<Name>Group1</Name> //- This was causing the issue. It is weird that for some group names it was working but for others it did. So I just kept it like this
<Vusers>3</Vusers>
<Script>

View solution in original post

0 Likes
13 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

Hello,

Can you share the XML so we can have a look?

Thanks,

Shlomi

0 Likes
Highlighted
New Member.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

Thanks for replying. Below is the xml which I am using:

 

<Test xmlns="http://www.hp.com/PC/REST/API">
<Name>Sample_test_v1</Name>
<TestFolderPath>Subject\Integrated Release\Test Scenarios</TestFolderPath>
<Content>
<WorkloadType>
<Type>basic</Type>
<SubType>by group</SubType>
</WorkloadType>
<LGDistribution>
<Type>all to each group</Type>
<Amount>4</Amount>
</LGDistribution>
<Groups>
<Group>
<Name>B2B040_MA_QueryAddress</Name>
<Vusers>88</Vusers>
<Script>
<ID>2638</ID>
</Script>
<RTS>
<Pacing>
<NumberOfIterations>1</NumberOfIterations>
<StartNewIteration Type="fixed interval">
<DelayOfSeconds>10.07</DelayOfSeconds>
</StartNewIteration>
</Pacing>
<ThinkTime Type="random">
<MinPercentage>75</MinPercentage>
<MaxPercentage>125</MaxPercentage>
<LimitThinkTimeSeconds>5</LimitThinkTimeSeconds>
</ThinkTime>
<Log Type="standard">
<LogOptions Type="on error">
<CacheSize>10</CacheSize>
</LogOptions>
</Log>
</RTS>
<Scheduler>
<Actions>
<Action>
<StartGroup Type="immediately" />
</Action>
<Action>
<Initialize Type="just before vuser runs" />
</Action>
<Action>
<StartVusers Type="gradually">
<Ramp>
<Vusers>1</Vusers>
<TimeInterval>
<Seconds>10</Seconds>
</TimeInterval>
</Ramp>
</StartVusers>
</Action>
<Action>
<Duration Type="run for">
<TimeInterval>
<Hours>1</Hours>
<Minutes>35</Minutes>
</TimeInterval>
</Duration>
</Action>
<Action>
<StopVusers Type="simultaneously" />
</Action>
</Actions>
</Scheduler>
</Group>
</Groups>
</Content>
</Test>

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

 

Hi,

Do you get the error 1001 when sending the xml you send?
The xml contains 1 group, and according to what you have wrote 1 group works fine for you.
Can you send the one with more than 1 group?

Thanks,
Eyal

0 Likes
Highlighted
New Member.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution
Hi, as of now it is not even working for 1 group. I get the error when i post the above xml.

Case in which it was working was, i created the scenario in pc and get the xml for that scenario. When i post that xml through script it was working. I could see the scenario created in the pc.

I hope i am not confusing you.

The error message is not cleared. There is no messages in pc server logs. I think logging is disabled.

While looking at the api refernece documentation. Operation failed means general error but what kind of error i am not able to figure out.

Thanks,
0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

Hi,

The XML looks valid and I also used the same data to successfully create a new test.
Please try the following that will help you getting the XML data required to be sent:

  1. Create the required test from PC UI (MyPC or ALM client)
  2. Send HTTP request to get the test data using PC REST API (http://<PC server>/LoadTest/rest/domains/<domain</projects/<project/tests/<test id>)
    Note: replace the value between <> to the value in your environment.
  3. Copy the response body and use it in the call to create new test. You should delete the fields ID, CreatedBy and LastModified

Which PC version are you using?

Regards,
Eyal

0 Likes
Highlighted
New Member.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution
Thanks Eyal.

But i had already tried this method but it worked only for that group and when i added other groups details. I got the same error.

Is there any way where i can check what the cause of error?
0 Likes
Highlighted
New Member.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

I again tried the same method. I created the scanerio for 1 group in PC and got the xml using API. If I use the same group name and script ID , it creates the scenario but if I change the group name and script id in the xml and post and I get the operation failed error.

0 Likes
Highlighted
New Member.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

The PC version is 12.20 , Build 12.20.677.0

0 Likes
Highlighted
New Member.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

It worked. 🙂

 

The problem was in the <Name> </Name>. I was using the script name as the group name but it seems that it caused the issue.  So I changed the group name to Group{Uniquenumber} where uniquenumber is a unique number.  

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution


Great to hear it worked for you!
If only the name was the issue, verify you don't have an existing test with that name.

Regards,
Eyal

0 Likes
Highlighted
New Member.

Re: PC - Getting Error -Operation failed Error Code 1001

Jump to solution

The issue was not with the test scenario name.

<WorkloadType>
<Type>basic</Type>
<SubType>by group</SubType>
</WorkloadType>
<LGDistribution>
<Type>all to each group</Type>
<Amount>4</Amount>
</LGDistribution>
<Groups>
<Group>
<Name>Group1</Name> //- This was causing the issue. It is weird that for some group names it was working but for others it did. So I just kept it like this
<Vusers>3</Vusers>
<Script>

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.