Topic for comments about Browser library keyword Wait For Elements State
Element States Issues
Pls, give me some tips on how to use states, because now the same error is listed. In this case, I wait until the element is not visible. Thnx.
RF 3.2.2, RED editor, python 3.10.2,
Could you raise an issue on Github?
I have to check that.
I set this keyword to fail after 20 seconds but it seems to be taking 5min 31sec very often. Is there a known reason for the timeout limit being exceeded? Is there a way to avoid this, should I use Wait For Condition instead?
How to handle with multiple elements?
Example:
In a FOR loop keyword, theres is ONLY one element in DOM:
//p[.=âPĂłs-vacina/Serviços FarmacĂȘuticosâ]
but after some actions, this there will be more of this element:
! handler execution failed: Error: locator.waitFor: Error: strict mode violation: locator(â//p[.=âPĂłs-vacina/Serviços FarmacĂȘuticosâ]â) resolved to 2 elements:
1)
PĂłs-vacina/Serviços FarmacĂȘuticos
aka getByText(âPĂłs-vacina/Serviços FarmacĂȘâ).first()2)
PĂłs-vacina/Serviços FarmacĂȘuticos
aka getByText(âPĂłs-vacina/Serviços FarmacĂȘâ).nth(1)Call log:
- waiting for locator(â//p[.=âPĂłs-vacina/Serviços FarmacĂȘuticosâ]â) to be visible
How do I proceed?
Hi Matheus
try this xpath:
(//p[.=âPĂłs-vacina/Serviços FarmacĂȘuticosâ])[1]
the part inside the brackets ()
can return multiple and the [1]
says always take the first one, see XPath Syntax > Predicates for more detail
Dave.
Thanks for the reply!
Iâll try this. Appreciate.