Reputation: 99
I have the path in the HTML style:
<div class="BaseL">
<ul class="list">
<li draggable="true" class="listEntry" id="ItemList.item.0" widgetid="ItemL.item.0" >
The code that I have used is: driver.findbyElement(By.cssSeelector(".BaseL.list.item.0"))
Its not able to find it by id, tried webdriver.wait (didn't work). But even the cssSelector isnt working, can anyone please help me to find the cssSelector? Thanks.
Upvotes: 0
Views: 4203
Reputation: 649
If you want to find your element by Id:
driver.findbyElement(By.cssSelector(".ItemList.item.0"));
by Class:
driver.findbyElement(By.className("#listEntry"));
Upvotes: 1
Reputation: 193068
You can use either of the following css-selectors:
"div.BaseL>ul.list>li.listEntry[id^='ItemList'][widgetid$='0']"
PS: As it is a draggable element you have to induce WebDriverWait
Upvotes: 0
Reputation: 14135
Here is the correct CSS.
You have to mask the .
in the li id
with \
.BaseL .list #ItemList\.item\.0
Upvotes: 0