I have a Selenium WebElement selected, for example like this:
WebElement element = webDriver.findElement(By.xpath('//div/span[@id='test']'));
If i have no knowledge about how i found this element, how can i select the same element with JQuery? All i have is the webDriver instance and the element instance.
Spoken in "pseudo-code", i want something like this:
webDriver.executeScript("$(" + element.getUniqueSelector() + ").attr('id', 'test2')");
/edit
I got my answer: jQuery element selector with Id from Selenium 2 / WebDriver