CSS 선택기를 사용하여 요소를 찾을 때 여러 가지 방법으로 작성할 수 있습니다. 예를 들어 : 나를 위해CSS 선택기 구문과 Selenium의 이점은 무엇입니까
driver.FindElement(By.CssSelector("header.top-bar.js-top-bar._fixed"));
대
driver.FindElement(By.CssSelector("header[class='top-bar js-top-bar _fixed']"));
및
driver.FindElement(By.CssSelector("form[id='search'][action='/search']"));
대
driver.FindElement(By.CssSelector("form#search[action='/search']"));
는 단지 체육의 rsonal 다른 통해 하나를 사용하여 선호하지만, 예를 들어 사용하여 모든 성능 이점이 있는지 궁금 해서요 :
header.top-bar.js-top-bar._fixed
대 header[class='top-bar js-top-bar _fixed']
감사를 tag.class보다 더 나은 성능을 가지고 말을하는 것이 안전합니다 이 링크를 제공하면 어떻게 실제 테스트를 수행 했습니까? – Marcel