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
419 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,460 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,460 points
4,180 views
0 votes
2 answers

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

some of the controls not have id ...READ MORE

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
1,598 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
13,832 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,910 points
4,133 views
0 votes
2 answers

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,500 points
12,786 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,643 views
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,910 points
6,724 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,580 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,460 points
6,911 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP