Could not validate that Value_Edit has the expected value of '-90

Ask general questions here.
sepr8084
Posts: 3
Joined: Tue Feb 19, 2019 2:01 pm

Could not validate that Value_Edit has the expected value of '-90

Post by sepr8084 » Mon Mar 11, 2019 3:44 pm

I am struck with a error: '' Could not validate that Value_Edit has the expected value of '-90'. '' Is this error due to the WinForms Waring Message as mentioned below ?

--> I tried debugging, But could not find root cause. One test case works fine and another not. But both are of same functionality with different GUI controls.


[2019/03/11 15:14:32.604][Warn ][WinForms]: Failed to load the assemblies containing the definition of this control. UI element identification capabilities for this control are limited. Failed assemblies:
C:\Program Files\CONEXANT\Flow\Flow.exe
Process: 'Flow' (pid 7612)
The following website provides more information on this technology limitation:
https://www.ranorex.com/help/v8.3/inter ... etWinForms
(This message is only shown once per report.)

[2019/03/11 15:14:34.066][Info ][Action]: Starting SUT
[2019/03/11 15:14:36.750][Success][Validation]: TabPageList Self.Visible is True.
[2019/03/11 15:14:36.804][Info ][Module]: Module StartSUT ended.
[2019/03/11 15:14:36.810][Success][Test]: Test Module 'StartSUT' completed with status 'Success'.
[2019/03/11 15:14:36.810][Info ][Test]: Test Module 'StartCircularGaugeTab' started.
[2019/03/11 15:14:36.855][Info ][Module]: Module StartCircularGaugeTab started.
[2019/03/11 15:14:38.507][Info ][Module]: Module StartCircularGaugeTab ended.
[2019/03/11 15:14:38.512][Success][Test]: Test Module 'StartCircularGaugeTab' completed with status 'Success'.
[2019/03/11 15:14:38.514][Info ][Test]: Test Module 'TC_CircularGaugeValue' started.
[2019/03/11 15:14:38.560][Info ][TestCase]: Test Case TC_CircularGaugeValue started.
[2019/03/11 15:14:38.614][Info ][TestStep]: ***Test Step 1 started ***:
Description:
The software should support definable vALUE value in positive and negative range.
Expected result:
The Value is definable as positive and negative.
[2019/03/11 15:14:40.347][Success][Action]: Found Value_Edit and set text to '-90'.
[2019/03/11 15:14:54.927][Failure][Validation]: Could not validate that Value_Edit has the expected value of '-90'. Underlying failure:
-> Could not get text from Value_Edit because it could not be found. Underlying failure:
--> Could not find Value_Edit within 12 seconds.
[2019/03/11 15:14:55.024][Error ][Module]: Module execution was aborted because a validation step has failed. Could not validate that Value_Edit has the expected value of '-90'. Underlying failure:<br/>-&gt; Could not get text from Value_Edit because it could not be found. Underlying failure:<br/>--&gt; Could not find Value_Edit within 12 seconds.

[2019/03/11 15:14:55.137][Failure][Test]: Test Module 'TC_CircularGaugeValue' completed with status 'Failed'.
[2019/03/11 15:14:55.139][Info ][Test]: Test Module 'StopSUT' started.
[2019/03/11 15:14:55.176][Info ][Module]: Module StopSUT started.



Code that results in above error:

Code: Select all

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Threading;
using WinForms = System.Windows.Forms;
using System.Windows.Forms;
using Ranorex;
using Ranorex.Core;
using Ranorex.Core.Testing;
using SussGUITestAutomation.Utils;
using Ranorex.Core.Repository;
namespace SussGUITestAutomation.TestCases.CircularGauge
	
{
   
    [TestModule("05E875B3-A233-40E6-A8F6-34D7775636FF", ModuleType.UserCode, 1)]
    public class TC_CircularGaugeValue : TestCase, ITestModule
    {

            private readonly SussGUITestAutomationRepositoryFolders.TabPageCircularGaugeFolder _repoCircularGauge =
            Repos.Gallery.TabPageList.TabPageCircularGauge;

  public override void Execute()
        {
            DoStep(
                1,
                "The software should support definable vALUE value in positive and negative range.",
                $"The Value is definable as positive and negative.",
                () =>
                {
                    SetValue(-90, _repoCircularGauge.Values.Value_EditInfo);
                    SetValue(80, _repoCircularGauge.Values.Value_EditInfo);
                });
        }
          private void SetValue(int _value, RepoItemInfo _edit)
        {
            Report(Do.Text.SetText(_edit,_value));
            Report(Validate.Text.IsExpectedValue(_edit,_value));
        }
    }
}
Code which works fine:

Code: Select all

using Ranorex;
using Ranorex.Core;
using Ranorex.Core.Repository;
using Ranorex.Core.Testing;
using SussGUITestAutomation.Utils;

namespace SussGUITestAutomation.TestCases.KnobSlider
{
    /// <summary>
    /// 	Tested Requirements: 6207, 6222, 6216, 6127 and 6251
    /// </summary>
    [TestModule("B4609399-7055-499E-BC2B-E8D34548156A", ModuleType.UserCode, 1)]
    public class TC_KnobSliderProperties : TestCase, ITestModule
    {
        private readonly SussGUITestAutomationRepositoryFolders.TabPageKnobSliderFolder _repoKnobSlider =
            Repos.Gallery.TabPageList.TabPageKnobSlider;

        public TC_KnobSliderProperties()
        {
            // Do not delete - a parameterless constructor is required!
        }

        public override void Execute()
        {
            DoStep(
                1,
                "The software should support definable vALUE value in positive and negative range.",
                $"The Value is definable as positive and negative.",
                () =>
                {
                    SetValue(-10, _repoKnobSlider.Properties.Value_EditInfo);
                    SetValue(10, _repoKnobSlider.Properties.Value_EditInfo);
                });

        }

        private void SetValue(int _value, RepoItemInfo _edit)
        {
            Report(Do.Text.SetText(_edit, _value));
            Report(Validate.Text.IsExpectedValue(_edit, _value));
        }
    }
}

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

Re: Could not validate that Value_Edit has the expected value of '-90

Post by odklizec » Tue Mar 12, 2019 8:39 am

Hi,

At first, could you please post a Ranorex snapshot (NOT screenshot), both from working and non-working GUI?
At next, which Ranorex version do you use (most recent and supported versions are 8.3.3 and 9.0)?

The winform error, you are getting, could definitely have something to do with your problem. Unfortunately, it's impossible to tell anything definitive, without seeing your app under test or, at very least, Ranorex snapshot of the problematic UI control (which may not be enough for such kind of issue). BTW, do you run Ranorex Studio/your test in administration mode? Runing test in administration mode, often fixes similar winform identification errors.
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

sepr8084
Posts: 3
Joined: Tue Feb 19, 2019 2:01 pm

Re: Could not validate that Value_Edit has the expected value of '-90

Post by sepr8084 » Tue Mar 26, 2019 3:02 pm

I added an automation Id in EditSpy for Value and ran the Ranorex in Administrator mode and it worked.

thank you.