Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб Selenium with C# 13 - Selenium Locators Best Practices | How to choose a right selenium locators в хорошем качестве

Selenium with C# 13 - Selenium Locators Best Practices | How to choose a right selenium locators 6 лет назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



Selenium with C# 13 - Selenium Locators Best Practices | How to choose a right selenium locators

Selenium Locators Best Practices Like our facebook page www.facebook.com/ankprotraining Selenium Locators Best Practices : 1. If you have access to the developers ask them to add the IDs to elements 2. If application under test has lot of dynamic ids, target the stable part of the id ex: lessthan span id='myproduct-1234' greaterthan Xyz mobile phone lessthan /spangreaterthan Then target only ‘myproduct’ 3. Your order of locator should be If your target is single element Id - Name - CSS Selector -Xpath(Relative) If your target is multiple elements ClassName - TagName - CSS Selector - Xpath(Relative) If your target element is a link with shorter link text LinkText - href If your target element is a link with longer link text PartialLinkText - href 4. Keep your XPath or CSS short EX: Instead of //div/table[@id=‘mytable’] use //*[id=‘mytable’] instead of div table #mytable use #mytable 5. If you do not get a element with Id or Name use the parent or child element as your reference in your relative xpath div id="subjects" class=”content” ul li English /li li Maths /li li Science /li /ul /div If your target element is li English /li then you can find element by IWebElement firstSubject = driver.FindElement(By.CssSelector("#subjects li : first-child")) or IWebElement firstSubject = driver.FindElement(By.XPath("//*[@id='subjects']/ul/child::li[1]")) 6. Avoid absolute xpath Ex: /html/body/div/div/div/div/div/div[2]/div/div/div/div/div[2]/div/span 7. Avoid using xpath and css finding tools like firepath and chropath to get xpath of css as they may not give you optimized xpath or css. 8. Always keep a cheat sheet in your work desk Possible Interview Questions on Selenium locators best practices : What are the best practices of selenium Webdriver locators? What is the locators priority order?

Comments