Preferring CSS over XPath in Selenium

0 votes

I am working on an application which only supports IE7 and IE8. I found that CSS is used more as compared to XPath while identifying the elements in IE. I would like to know what is the differences between using CSS and XPath and in which situations I should use CSS and in which should I use XPath if I am using IE.

May 31, 2018 in Selenium by Atul
• 10,240 points
42 views

1 answer to this question.

0 votes

Advantages of using CSS:

  • They are faster
  • More readable
  • CSS is jQuery’s locating strategy​
answered May 31, 2018 by Meci Matt
• 9,420 points

Related Questions In Selenium

0 votes
1 answer

Which is preferred more in Selenium Absolute or Relative XPath

Absolute XPath is the direct way to ...READ MORE

answered Apr 20, 2018 in Selenium by Meci Matt
• 9,420 points
1,043 views
0 votes
1 answer

what is the need of xpath when you have attributes like id ,class,name in selenium?

It is not necessary that every element ...READ MORE

answered Jun 1, 2018 in Selenium by Vinita
• 220 points
160 views
0 votes
1 answer

preceding-sibling in xpath, Selenium?

Here, ul has 8 children(8-li) on total.  And, ...READ MORE

answered Jun 1, 2018 in Selenium by Vinita
• 220 points
1,688 views
0 votes
1 answer

Getting the proper xpath for date picker in selenium

Try to use explicit wait. Sometimes it ...READ MORE

answered Jul 5, 2018 in Selenium by Samarpit
• 5,130 points
1,423 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
554 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
888 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
550 views
0 votes
1 answer

XPath for the elements with no ID or Name in Selenium Webdriver

Use like this or similar to this: //div[@id="top-level-menu-item-3"]/div[@class="filter-label"] //div[@id="top-level-menu1"] ...READ MORE

answered Apr 17, 2018 in Selenium by Meci Matt
• 9,420 points
1,235 views
0 votes
1 answer