0

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.

1
  • You have typos in your code to select the element. Commented Jun 13, 2019 at 21:10

3 Answers 3

1

If you want to find your element by Id:

driver.findbyElement(By.cssSelector(".ItemList.item.0"));

by Class:

driver.findbyElement(By.className("#listEntry"));
Sign up to request clarification or add additional context in comments.

1 Comment

@IPonik please make correction in your answer. Both line showing css selector with little grammer mistake
0

Here is the correct CSS.

You have to mask the . in the li id with \

.BaseL .list  #ItemList\.item\.0

enter image description here

Comments

0

You can use either of the following :

"div.BaseL>ul.list>li.listEntry[id^='ItemList'][widgetid$='0']"

PS: As it is a draggable element you have to induce WebDriverWait

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.