# Thread: Use of 16 digit Credit Card Number

1. ## Use of 16 digit Credit Card Number

I am exporting the data from Excel Sheet to QC where I am using the Credit Card number as 16 digits.
I have changed the format of shell in Excel Sheet as 'Number' to accept 16 digits.

When I am running the scripts by Importing the data from QC to QTP then I am getting error.

Please help me to use Credit Card Number by importing data from QC to QTP.
Thanks!

2. ## Re: Use of 16 digit Credit Card Number

What is the error that you are getting when you import from QC to QTP?

3. ## Re: Use of 16 digit Credit Card Number

ok , the 16 digits will be converted exponentially

give a ' before your number to prserve the format and dont change the format of the shell.

e.g., '11111111111111111111111

4. ## Re: Use of 16 digit Credit Card Number

I think, do not format the external sheet. Use the default formatting.

6. ## Re: Use of 16 digit Credit Card Number

Thanks for your reply but I am not able to fill the data in the field using the above suggestions.

I am able to import the data from the Excel sheet from QC to QTP as I have used the number in double quotes "4111111111111111". But when it is putting this data in the Credit Cart Number field in the application then I am getting the error as 'The parameter is incorrect.'

As I have written the script as Browser("BrowserName").Page("PageName").WebEdit("C artNumber").Set oDict("CreditNumber")

As I have created a Function as:

Function StringToDictionary (str)
Dim oDict
Set oDict = CreateObject("Scripting.Dictionary")
oDict.RemoveAll

aPairs = Split(str,";")
For each pair in aPairs
'account for '=' in value part
nLocOfFirstEqualSign = InStr(pair,"=")
If nLocOfFirstEqualSign &gt;= 1 Then
sKey = Mid(pair,1,nLocOfFirstEqualSign - 1)
sVal = Mid(pair,nLocOfFirstEqualSign + 1)
'Cast numeric values to either long or double data types
sFirstCharacter = Left(sVal,1)
If IsNumeric(sVal) And sFirstCharacter &lt;&gt; "0" Then
If Fix(sVal) - sVal = 0 Then 'is sVal an integer
sVal = CLng(sVal)
Else 'sVal is assumed to have decimal places
sVal = CDbl(sVal)
End If
End If
Else
Reporter.ReportEvent micFail,"StringToDictionary","Equal sign expected in key value pair." &amp; vbcr &amp; "pair=" &amp; pair
End If
Next
Set StringToDictionary = oDict
End Function

But Now If I am using the Credit Cart Number as '4111111111111111 then it is not working.

Please help me and check the function and let me know if I need to make the changes in the function to recognize the Credit Cart number in the field.
Thanks!

8. ## Re: Use of 16 digit Credit Card Number

Thanks Tarun

I am getting the same error as specified in the Link u have mentioned, but Still this is not the solution for this problem.

Even I have used the Browser("B").Page("P").webEdit("E").Set CStr(oDict("CartNumber"))

I have checked the same using the single quotes, double quotes but not able to set the value in the field from Global Sheet.

Thanks!

9. ## Re: Use of 16 digit Credit Card Number

Sood,

Can you post the html code for the edit box here?

10. ## Re: Use of 16 digit Credit Card Number

Do below

Msgbox oDict("CartNumber")
Msgbox Len(oDict("CartNumber"))

The length shouldn't be greater than the max length allowed in CC text box i.e. 16

Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:27 PM.