Text gets entered in between in the text field using JSON file

Ranorex Spy, Recorder, and Studio.
Priyanshu
Posts: 20
Joined: Wed May 22, 2019 5:48 am

Text gets entered in between in the text field using JSON file

Post by Priyanshu » Thu Sep 26, 2019 7:30 am

Hi team,

I am facing one issue , when I am trying to put text in the text field through JSON, text gets entered but again when I am entering the text instead of last point of the current text , JSON text gets entered in between . Could you please suggest the solution ? Attached the snapshot of the field.

Below is the code
public void EnterMakro(RepoItemInfo txtInfo,RepoItemInfo btnInfo, string makroData)
{
if(txtInfo.Exists(ConstantsFile.DelayStandard))
{
Text txtItemsList = txtInfo.CreateAdapter<Ranorex.Text>(false);
if(txtItemsList.TextValue.Length>0)
{
Report.Info("Less text");
}
clk.PerformTextPresskeys(txtItemsList, makroData);
Button btnItemsList = btnInfo.CreateAdapter<Ranorex.Button>(false);
btnItemsList.Click();
Report.Info(txtInfo + RanorexResource.SPACE + RanorexResource.added);
}
else{
Report.Error(txtInfo + RanorexResource.SPACE + RanorexResource.detailsNotAdded);
}
}

rplyWindObj.EnterMikro(rplyWinRepo.Svarsregistrering.PnlRight.UtlatandeEditorInfo,rplyWinRepo.Svarsregistrering.MikroInfo,JSONActionFile.testData.Mikro);

JSON file data:

"Mikro": "\nTest Makro data added.\nTest Makro data added.\n",
Attachments
Editor.zip
(614.48 KiB) Downloaded 1 time

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 5187
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Text gets entered in between in the text field using JSON file

Post by odklizec » Thu Sep 26, 2019 8:06 am

Hi,

Have you tried to send "End" shortcut to the edit field, before entering next text?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration