question

bmcmanus avatar image
bmcmanus asked ericnute edited

Date conversion function

I have a common problem when comparing dates with different formats between two data repositories. I built the code to translate 01/01/2013 to 2013-01-01 as follows - can I create a function in iTest that I can pass a value and return a converted value? Here is my translate code: set todate "[xpathEval translate("[xpathEval concat("[xpathEval substring("$todate",7,4)]","-","[xpathEval substring("$todate",1,5)]")]","/","-")]"
iTestxpathanalysis rule
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
sai_kiran avatar image
sai_kiran answered
We can translate 01/01/2013 to 2013-01-01 by adding Query analysis rule to store the values. Please check the attached test case for your reference. Hope it helps!!

test_case.fftc (3.5 KiB)
2 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bmcmanus avatar image bmcmanus commented ·
Many thx - how do I convert this xml file into a testcase?
0 Likes 0 ·
sai_kiran avatar image sai_kiran commented ·
We can open the xml file into a test case by following the below settings in iTest. Rightclick on xml file -> Open With -> Other -> Test Case Editior. Attached is the screenshot for your reference. ![alt text][1] [1]: /storage/temp/3655-screenshot.png
0 Likes 0 ·
screenshot.png (62.2 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.