That code works very fine! Finds my only one button in that span tag, and clicks.
driver.findElement(By.cssSelector("span[id$=somePagesCollection] a")).click();
Then, after clicking button, appears input field.
driver.findElement(By.cssSelector("span[id$=somePagesCollection] input[id$=somePagesCollection_0_url]")).sendKeys("some");
What i've got?
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"css selector","selector":"span[id$=somePagesCollection] input[id$=somePagesCollection_0_url]"} Command duration or timeout: 16 milliseconds
Looking into the outer html of that element. What i'm doing wrong?
<input id="s567bb2e58337a_somePagesCollection_0_url" name="s567bb2e58337a[somePagesCollection][0][url]" required="required" class=" form-control" type="url">
Example from browser console.
$('span[id$=somePagesCollection] input[id$=somePagesCollection_0_url]').hide()
Another example from browser console that works well, but not in selenium.
$('span[id$=somePagesCollection] tr:nth-child(2) td:nth-child(2) input').hide()