Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98819

Issue locating elements with dynamic ids

$
0
0

I'm kinda new to selenium, and I'm stuck at figuring out one problem: I have an input that's inside this html block and my task is locate it and send keys. The problem is that not only the id is dynamic, but also css selector and Xpath

It all looks like this

Xpath //*[@id="qf_25239c53-8f51-a9af-adff-fb4c61c369dd"]
CSSselector # qf_6fc767f5-f6d9-ce40-dc78-df0e43f6dc75
<label data-v-1a920554="" for="qf_b75b7021-5df4-2283-1c79-23bddcde3a3d" class="q-field row no-wrap items-start indent q-input q-field--outlined q-field--dense">
<div class="q-field__inner relative-position col self-stretch column justify-center">
<div tabindex="-1" class="q-field__control relative-position row no-wrap">
<div class="q-field__control-container col relative-position row no-wrap q-anchor--skip">
<input tabindex="0" placeholder="Заголовок" id="qf_b75b7021-5df4-2283-1c79-23bddcde3a3d" type="text" class="q-field__native q-placeholder"></div></div></div></label>

I solved no such element exception by doing this

IWebElement MarkerNameInput = Setup.Driver.FindElement(By.XPath("(//*[@class = 'q-field__native q-placeholder'])[1]"));

But it had only fixed one exception with another and now I'm stuck at:

InvalidSelectorException: invalid selector: An invalid or illegal selector was specified

So the question is what is the correct way to locate input, so I can send keys inside of it?


Viewing all articles
Browse latest Browse all 98819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>