Hello
In c#, I want to find elements that have either a given role, either a specific classname
I want to fins all alerts
The code :
The error :
What the fuck ? 😊
Thank you all !
David
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/93de7136b1fe4f7494bb9ca4ed090975%40cph.be.
But yes !!! 😊
Thanks
De : seleniu...@googlegroups.com <seleniu...@googlegroups.com>
De la part de Amal a a
Envoyé : jeudi 19 mai 2022 10:23
À : seleniu...@googlegroups.com
Objet : Re: [selenium-users] Xpath @role or contains(@class)
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAChdQkha69L%3DWZpxJSpKzNiH-fnr%3D238XEOQ%2B1rwa0bhts0CvA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/93de7136b1fe4f7494bb9ca4ed090975%40cph.be.
Yes, somoeone have found the mistake
Thanks
De : seleniu...@googlegroups.com <seleniu...@googlegroups.com>
De la part de Sambhav Dave
Envoyé : jeudi 19 mai 2022 12:19
À : seleniu...@googlegroups.com
Objet : Re: [selenium-users] Xpath @role or contains(@class)
I think the correct xpath should be :
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAEEKWAdw-4m3OajzjXx5nPVXONO9TzsOYVk8_C2dX3sPnpTrcQ%40mail.gmail.com.
--
- this.Driver.FindElements(By.XPath("//div[@role='alert' or contains(@class,'alert')]")))
--
Nice ! Thanks
De : seleniu...@googlegroups.com <seleniu...@googlegroups.com>
De la part de Scott Babcock
Envoyé : mercredi 25 mai 2022 07:54
À : Selenium Users <seleniu...@googlegroups.com>
Objet : Re: [selenium-users] Xpath @role or contains(@class)
One thing to be very careful with in XPath is the `contains` function. With the formulation shown in example in this thread, you have the potential for incorrect matches. Use this instead:
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2ef64b0c-da13-40c5-8e5a-d0f524ecea3an%40googlegroups.com.