Could anyone tell me how to correctly find the css selector for the following code. I need to know the css selector and not the xpath as web elements cannot use xpath.
<div id="drag" class="dojoDndSource dojoDndTarget dojoDndContainer" style="height:300px;width:250px;font-size:1.2em;border:2px solid #ccc; padding:1em;overflow:auto; " data-dojo-type="dojo.dnd.Source">
<div id="1" class="dojoDndItem" style="padding:.5em;">1</div>
<div id="2" class="dojoDndItem" style="padding:.5em;">2</div>
<div id="3" class="dojoDndItem dojoDndItemAnchor" style="padding:.5em;">3</div>
<div id="99" class="dojoDndItem" style="padding:.5em;">T4</div>
<div id="100" class="dojoDndItem" style="padding:.5em;">T5</div>
I wish to select the div with id="99". I've tried using the following:
driver.findElement(By.cssSelector(".T4"));
driver.findElement(By.cssSelector("//input[@id='gbqfq']"));
ids?//input[@id='gbqfq']is XPath, not a CSS selector.