trying to insert the data from excel and have SSN also among them. script is reading the value correctly from excel but SSN values are jumbling while setting into the test box. eg: 123-45-6789 (actual) but inserting as 945-78-1236.
What specifically are you insert the data into?
Is there any sort of field validation or parsing happening?
How is the text being entered, is it SetText or SendKeys?
I have seen where browsers handle dates differently, so depending on this field there might some specific property that is different between browsers. I haven’t really seen that, but it is possible.
You’ll probably need to do some experimentation.
What happens if you use SendKeys?
What happens if you have a Delay before you use SendText?
How does the field appear if you enter 123456789 and 123-45-6789? Are both of those valid and accepted?
What happens if you paste 123-45-6789 and 123456789 into the field? With and without the dash?
Additionally, if you the Spy feature of Katalon or use the Katalon Recorder for Firefox or Chrome, how does it show the action of entering text into that field? And if you play that action back again, is the field populated as expected?
Most likely there is something about the field causing this issue. You may need to type the values rather than paste the value (SendKeys vs SetText)
send keys, delay, timeout options but still no luck and entering the numbers with shuffling. if I do it manually like entering from keyboard/copy paste its working fine and the dashes are taking automatically even though I copied without dashes.
this is happening in chrome only and other browsers are not working for me.
thanks and send me your suggestions if u find any.
Does that mean the dashes are entered automatically? If so, there is validation for that field which could be throwing off entering data.
Does this mean it is working in Chrome and failing in all other browsers? Does it work for a certain browser but not for others? If it works for one, but not others, you will need to set up conditional code to handle the different browsers.
But at this point, it still sounds like the issue is related to the browser and form validation. Do you have any of the output from your previous testing?
This pretty much guarantees there is a validator/event handler dealing with inputs to that field.
You could try sendKeys again using an ENTER key to commit the change or a TAB key to move away from the field and trigger onblur/onchange handling. You can use firefox to open the event handlers directly on the element. Here is a screenshot of this textarea on THIS PAGE - the one you’re reading - look at all the event handlers
You can also try ssn.onchange() instead of onblur(). If you’re convinced that something in the code makes the dashes appear, one or other of the events you saw listed in the popup MUST be doing it - you just need to find which one.
If you cannot get this block of code to work, then you should go back to using sendKeys (I still think that’s your best option).