Ok, so suppose you're writing a selenium script that opens a website, logs in, navigates to a page where you enter in a search query, enters some stuff, presses enter, and you get back a page full of tables and cells (tr / td). You want the value of what's in a particular cell.
The bad news: none of the cells have any identifiers (like, no id = ?? or class = ??). So you can't just findElement(By.id("thecellsid").
The good news: you know that typing in that query will yield the same table every single time.
So I figured, was there some way to find it by its location on the webpage?? On firefox, there is a function called "Copy Unique Selector" that gives me the XPath for the element.
Well, after some googling, I discovered that selenium has a findElement(By.xpath("")) method as well as a By.cssSelector method, but the formats look a different.
In other words, the path isn't really copy/paste-able. I was wondering if there was some method or algorithm to convert it, or if maybe there's an easier way to do this.