cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing URL with CBTA tool

Former Member
0 Kudos

Hello.

I would like to ask you if it is possible to somehow decompose URL with CBTA to read parameter which is added in process of testing.

For example:

  1. CBTA should log into internet shop - OK
  2. CBTA pick items to basket and proceed to check out - OK
  3. CBTA confirm order - OK
  4. CBTA should pass order number to another automated script - NOK

Order number is available in page body, so it would be possible to write custom script to decompose order ID from it. But it is also possible to find order ID in URL because in process of ordering items from shop final ID of order is added at the end of URL.

Do you have any ideas how to solve this problem?

Thank you very much.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Is the order also displayed on the page too, e.g. in the message area ?

Former Member
0 Kudos

Yes order ID is also displayed on page. Here is the HTML code where ID can be found.

<h2 class="font-primary--light con-h1 m-0">Číslo vaší objednávky: 89774039</h2>

As you can see, problem is, that ID is part of another text.

Do you have any idea how to extract it?

Thanks

0 Kudos

You can try the approach described in the following document:

http://service.sap.com/~sapidb/011000358700000194852014E.PDF

If this does not work you can use the default components CBTA_Web_GetProperty to capture the string containing the order ID and use the approach described in my previous blog on how to extract single values from a string:

http://scn.sap.com/community/it-management/alm/solution-manager/blog/2014/10/10/how-to-use-string-fu...

Let me know if this works for you.

Regards Reiner

Former Member
0 Kudos

Hi.

I tried your advice described in blog. I think it could be the solution to my problem but I noticed that everytime I ran CBTA script URI for HTML tag with order ID is different. this is really another problem because if I use object spy to determine exact location of HTML tag, the final given URI contains also text value which is unfortunately different and CBTA script ends up in error.

Do you have any suggestion or idea about this problem? is there any "wild character" I can use, e.g. "*" or "%"?

for info here is the URI:

tag=H1; innerText=Objednávka č. 89774127; !parentId=content; parentTag=DIV

thank you

0 Kudos

Hi Jan,

you might be able to help yourself using the following material:

https://service.sap.com/~sapidb/011000358700000069212014E.ZIP

in document 'CBTA 3.0 SP2 - Test Automation Challenges. pdf' starting at page 41.

So this might work:

.... innerText~=Objednávka$;

Regards Reiner

Former Member
0 Kudos

Hi Reiner.

Thank you very much for your materials. It helps me a lot.

I tried to use regular expresions as is described in materials and your blog and it works perfectly.

Thank you.

Now I figured yout that there are some limitations to this aproach. Unfortunately regular expresions cannot be used with html tag ID or NAME.

Thank you again for your help.

Regards Jan.

Former Member
0 Kudos

HI Reiner

I not sure if you have seen my posting I have a couple other questions on CBTA you maybe to help me with...or send me links to the right materials

Via CBTA  how can we test a file upload scenario e.g. for Bulk uploads requirements especially around HR?

When testing the Universal Worklist, how can we get CBTA to pick up a specific workitem in the UWL?

Really appreciate any help you can give

Cheers

Peter

0 Kudos

Hi Peter,

sorry for delay. I'm busy with many customer requests and did not have a quick answer to your questions.

For question one you most likely need to use custom functions as described in chapter 13  of the How-to Guide. You can try to use an existing pattern that might need to be adjusted:

For 2nd question please check this document

http://service.sap.com/~sapidb/011000358700000194882014E.PDF

Best Regards

Reiner

Answers (0)