Issue while using recorded script code

Ask general questions here.
mohan.pentyala
Posts: 32
Joined: Thu Sep 20, 2018 7:43 am

Issue while using recorded script code

Post by mohan.pentyala » Tue Oct 16, 2018 1:01 pm

Hi ,

I am trying to use the image-based recorded code from the code module. but I am getting below error s.Can you please help me to resolve the error s

Code generated in recording :

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Move item 'Fusion.txtToolbar' at 6;4.", repo.Fusion.txtToolbarInfo, new RecordItemIndex(0));
repo.Fusion.txtToolbar.MoveTo(new Location(txtToolbar_Screenshot3, "6;4", txtToolbar_Screenshot3_Options));
Delay.Milliseconds(200);

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Fusion.txtToolbar' at 6;4.", repo.Fusion.txtToolbarInfo, new RecordItemIndex(1));
repo.Fusion.txtToolbar.Click(new Location(txtToolbar_Screenshot2, "6;4", txtToolbar_Screenshot2_Options));
Delay.Milliseconds(200);

Error :

The name 'txtToolbar_Screenshot3_Options' does not exist in the current context (CS0103) - D:\Fusion\Fusion\Codemodule\UserCodeModule1.cs:143,87

The name 'txtToolbar_Screenshot3' does not exist in the current context (CS0103) - D:\Fusion\Fusion\Codemodule\UserCodeModule1.cs:143,87

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

Re: Issue while using recorded script code

Post by odklizec » Tue Oct 16, 2018 1:09 pm

Hi,

There is most probably missing txtToolbar_Screenshot3_Options and txtToolbar_Screenshot2_Options in your user code. Check this post:
image-validation-user-code-issue-t10263.html#p41188
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