-
When using a selector like: SeleniumBase generates the following error: [undefined]seleniumbase.fixtures.xpath_to_css.XpathException: Invalid or unsupported Xpath: Why is this selector is invalid? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
When you call a SeleniumBase method that requires a Javascript call, SeleniumBase needs to first convert any XPath selector to a CSS Selector in order for it to work, but for a complex XPath selector like the one you have above, there might not be a simple conversion that's possible. For that situation, you should try using a CSS Selector instead, or use an XPath selector that can be easily converted to a CSS Selector. |
Beta Was this translation helpful? Give feedback.
-
What I am trying to do is to use the contains and also next sibling so if I need to resort to css then I was thinking about: |
Beta Was this translation helpful? Give feedback.
-
Here is a screenshot that shows the html structure of the example I asked about above |
Beta Was this translation helpful? Give feedback.
When you call a SeleniumBase method that requires a Javascript call, SeleniumBase needs to first convert any XPath selector to a CSS Selector in order for it to work, but for a complex XPath selector like the one you have above, there might not be a simple conversion that's possible. For that situation, you should try using a CSS Selector instead, or use an XPath selector that can be easily converted to a CSS Selector.