PDA

View Full Version : Event recorder issues - Component Query Locator



developer@optrak.com
26 Apr 2016, 8:07 AM
Hi,

I used the Event recorder, and everything went fine (ST.play() lines were added to the code within an it() method).
But when I try to launch the test, I have an unexpected error : Failed with error "Component Query locator matches multiple items: "tab[text="Accounts"]"".

I already checked the page to make sure that there is no other items with the same id.

Do you have any idea on how to solve this problem?

Thank you :)

vojtech.cerveny
26 Apr 2016, 8:17 AM
Hi,
what do you get if you execute in console this command?
Ext.ComponetQuery.query('tab[text="Accounts"]')Is it item or array?

But if you have this error, you have to specify it more - look at doc (https://docs.sencha.com/extjs/6.0/6.0.2-classic/#!/api/Ext.ComponentQuery) for it. Something like
Ext.ComponentQuery.query('panel[cls~=my-cls][floating=true][title$="sales data"]');

And SenchaTest has an ability to NOT fail in this case - but in this case, I don't recommend it to you.
54426

Fell free to contact me any time.
Vojt?ch

developer@optrak.com
27 Apr 2016, 2:32 AM
I try the ComponentQuery, and it is an Array.

I did try to launch the test with the checkbox "Fail locators with multiple tests results" unchecked, and it worked!
...
But I have another error : Failed: Timeout waiting for target (textfield) to be available for pointerdown

Basically what I am trying to do is simply to create a new account in a table of accounts.
Everything is fine when the action required is a mouse click, but when it is a keyboard entry, I have this timeout.

vojtech.cerveny
27 Apr 2016, 3:10 AM
Ok, if it is array, you need be more specific, otherwise it takes a first item from array and it can do mess in your code. Look at a doc for more information, because you shouldn't use this settings for all cases.

And for another error - do you click on item menu or something, what appears and disappears after clicking?

Could you post your code here please?

Vojt?ch

developer@optrak.com
27 Apr 2016, 5:28 AM
Here is the code :

54433

And the Timeout error :
54434

There is is no matcher in the spec ; I just wanted to record an event properly.

The problem may come from the ST.play() commands - maybe add a sleep() somewhere.
Do you know where I can find any doc on ST.play() commands?

EDIT : If you need the whole project, I can post it. Just tell me which part of the code you need. Since it is not the same error than before, I will create a new thread for this one.

dongryphon
30 Apr 2016, 9:12 AM
At the time the test stalls out is the textfield present? The message would indicate that there is no result to the query for "textfield"...

developer@optrak.com
3 May 2016, 6:06 AM
No, the textfield is not present at the beginning of the test.
It appears when the button 'Create account' is pressed.

Is there any command in the ST.play() that allows the system to wait until the textfield pops up (like a sleep() ) ?

dongryphon
6 May 2016, 8:36 AM
The ST.play() call schedules each event and the player will wait for the query to find its target, so no need to code up a wait here. Two questions I guess: how long does it take for the textfield to appear? did the action required to display the textfield occur properly?

If the action is not playing properly for some reason then the textfield won't appear and the timeout will ensure. If the time it takes from action to appearance is longer then 5 seconds you might need to give the event a longer, explicit timeout value.