Ask a Question

Test Complete is reading the Date wrongly is there any solution for this?

Raviavi
Occasional Contributor

Test Complete is reading the Date wrongly is there any solution for this?

Hi I have date and time control with shown in image attached

When I did spying the control, the date formats are seen as 12:34 ,21/08/04 as shown in attached image

 

But when i use that control property in script to read that control, the date format is automatically changing to,21/08/04, 12:34 

 

Is there any way to use the same date time as is read during the spy in the script alos, i.e without getting it to re format what is being read from the control by test complete

7 REPLIES 7
AlexKaras
Community Hero

Re: Test Complete is reading the Date wrongly is there any solution for this?

Hi,

 

I cannot see the image for some reason, but these are two options that I can think of:

a) Examine the control using Object Spy (check if you are using Extended, but not Basic mode) and find a property that holds properly formatted control's value; (this is the preferred option)

b) If the control allows selection and copying its value, then you may consider a code like this (sample untested pseudo-code):

obj.Click(); // click control to focus it

obj.Keys('^A'); // Ctrl-A to select the whole field

obj.Keys('^C'); // Ctrl-C to copy control's value to the clipboard

var strValue = Sys.Clipboard; // store value from clipboard into variable

if (strValue == ... ) // proceed with verification as required

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Raviavi
Occasional Contributor

Re: Test Complete is reading the Date wrongly is there any solution for this?

Hi,

 

Its a read only control and i cannot do these ["Keys"] operations on the control

AlexKaras
Community Hero

Re: Test Complete is reading the Date wrongly is there any solution for this?

Hi,

 

I still cannot see the images after site update (@sonya_m  - FYI).

Can you confirm that you are using Object Spy / Object Browser in Extended mode and there is no property that contains properly formatted control's value?

Any chance to talk to developers and ask them how control's value is formatted before been rendered and whether they have some piece of advice on how you can get formatted value?

 

P.S.

read only control

'Read-only' not always means 'non-selectable' but as you've checked it, it is a pity that .Keys() does not work in your case.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
sonya_m
Community Manager

Re: Test Complete is reading the Date wrongly is there any solution for this?

Thanks for reporting the image issue, Alex, we are on it

Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
sonya_m
Community Manager

Re: Test Complete is reading the Date wrongly is there any solution for this?

@AlexKaras  as a temporary workaround, please try downloading the image by clicking the icon:2021-08-05_11-37-32.png

 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
AlexKaras
Community Hero

Re: Test Complete is reading the Date wrongly is there any solution for this?

@sonya_m :

Yes, with the click on the icon I can download and open the image.

Thank you for the workaround.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
TanyaYatskovska
Community Manager

Re: Test Complete is reading the Date wrongly is there any solution for this?

Hi folks, just wanted to let you know that we've fixed the issue with the image preview. Now, everything should work. Sorry for the inconvenience. 

 

As for the original issue, was it resolved? @Raviavi, do you need any more assistance from the community?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: