0
I have a situation that id, always updating randomly.. and without an apparent order making it possible for me to use find_element_by_id
the component is as follows::
<table id="treeview-2234-record-879" data-boundview="treeview-2234" data-recordid="879" data-recordindex="0" class="x-grid-item x-grid-item-selected" cellpadding="0" cellspacing="0" style="width:100%;">
What have I ever tried?
- Use recordid, but it repeats in some cases
- By class_name there are other components with the same class
- Of course, by the id.. which as I explained updates in all refresh and is Random
- I tried for the element text, but to no avail.
- At the root of treeview-2234, unsuccessfully.
I’m more of a victim of EXT
, some light?
also applies the data-recordindex='0'? can’t test at the moment.. but it works?
– Guilherme Lima
It will work for any valid CSS|XPATH selector. If you want to test if the selector works "manually" before running Selenium just open your browser console on the page you are testing and run something like this:
document.querySelectorAll("table[data-recordid='879']"); // CSS
$x("//table[@data-recordid='879']"); // XPATH, só funciona no chrome
– BrunoRB
I’ll try, thank you for the answer.
– Guilherme Lima
If solving your problem would be good you mark my answer as correct ;)
– BrunoRB
For sure I will,
– Guilherme Lima
There are more than one component with the same data-recordid, how can I get around that?
– Guilherme Lima