WaitFor AttributeNotEqual (null), empty string ... ?

Ranorex Spy, Recorder, and Studio.
loonquawl
Posts: 64
Joined: Wed Nov 22, 2017 10:08 am

WaitFor AttributeNotEqual (null), empty string ... ?

Post by loonquawl » Tue Mar 19, 2019 11:40 am

I have a cell in a table that should show a value, but sometimes takes a while. For the test to progress i have to wait for this call to have a value. The value i'm wating for can be any string, apart from an empty string.

In Studio I tried
  • WaitFor AttributeNotEqual Text (null) - but this throws an exception.
    WaitFor AttributeNotEqual Text [then i inserted nothing in 'Value'] - this does not wait, even if the cell is empty
    I then tried a GetValue on the cell, to find out what the value was, but it returned '' ....
    WaitFor AttributeEqual [then i inserted nothing in 'Value'] - just for kicks i tried this, and it actually waits 5 seconds and then reports that the Value did not equal ''
.. So the above experiments seem to show that the cell contains something that is not '', but gets returned by GetValue as '' - my question: What can i WaitFor to get around this conundrum? ( Note especially the humorous
... did not equal the specified value '' before timeout. The last value found was ''.
in the attached screenshot of the report.
WaitForNetExist.png
WaitForNetExist.png (45.7 KiB) Viewed 97 times
)

Win 7 64, Ranorex 9.0

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

Re: WaitFor AttributeNotEqual (null), empty string ... ?

Post by odklizec » Wed Mar 20, 2019 8:54 am

Hi,

Could you please share a Ranorex snapshot (NOT screenshot) of the table/cell in question? Ideally, take the snapshot before the cell is filled with data, so we can see, what exactly is stored in the problematic cell?

BTW, have you tried to store the GetValue result in variable and then use that variable in WaitFor AttributeNotEqual action? Maybe there is an invisible/non-printable character, stored in the cell, and this could be a reason why all your attempts failed so far? ;)
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

loonquawl
Posts: 64
Joined: Wed Nov 22, 2017 10:08 am

Re: WaitFor AttributeNotEqual (null), empty string ... ?

Post by loonquawl » Tue Mar 26, 2019 11:50 am

I can't share a snapshot, as it captures far too much system information.

I tried your suggestion about the Get Action.
Actions.png
Actions.png (12.16 KiB) Viewed 50 times
It delivers interesting results:
Getting attribute 'Text' from item 'Bosch_DiagnosticTool.Pnl_HMI.VarValue_HmiDiagnosis' and assigning its value to variable 'ttt_Inhalt'.
Setting attribute Text to '$ttt_Inhalt' on item 'Bosch_DiagnosticTool.Pnl_HMI.VarValue_HmiDiagnosis'.
Setting attribute 'Text' failed on element '{Cell:}'.
Die angegebene Methode wird nicht unterstützt.
If i skip the 'Set' step (i only included it to see what the Report will say) and get right to the Wait Step after the Get, the error is:
Waiting 5s for the attribute 'Text' to not equal the specified value $ttt_Inhalt. Associated repository item: 'Bosch_DiagnosticTool.Pnl_HMI.VarValue_HmiDiagnosis'
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Show/Hide Stacktrace
bei Ranorex.Core.Repository.RepoItemInfo.WaitForAttributeInternal(Duration waitTimeout, String name, Object value, WaitForAction action) bei Ranorex.Core.Repository.RepoItemInfo.WaitForAttributeNotEqual(Duration waitTimeout, String name, Object value) bei XXXx._02_Service_Tab.WaitFor_ValueInHmiDiagnosis.Ranorex.Core.Testing.ITestModule.Run() in c:\WORK\GIT\xxxx-testing-automation\xxxxx\xxxxxx\_02_Service_Tab\WaitFor_ValueInHmiDiagnosis.cs:Zeile 115. bei Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Int32 iterationCount, Boolean skipIteration)
the line mentioned above is from the Wait Action :
l:115 repo.xxxx.Pnl_HMI.VarValue_HmiDiagnosisInfo.WaitForAttributeNotEqual(5000, "Text", ttt_Inhalt);
Which is the same line that gets thrown as when i Wait for (null) - so i guessed that is the problem
The Spy delivers the following on that selfsame Cell, in the same state as it was in during the run that produced the above results (i.e 'looking empty')
Overview.png
Overview.png (4.97 KiB) Viewed 50 times
Advanced.png
Advanced.png (13.71 KiB) Viewed 50 times

loonquawl
Posts: 64
Joined: Wed Nov 22, 2017 10:08 am

Re: WaitFor AttributeNotEqual (null), empty string ... ?

Post by loonquawl » Tue Mar 26, 2019 12:14 pm

Addendum: Could this be related to this: error-with-a-definition-for-isempty-t13529.html ?