Содержание
- 2. Element selection WebElement cheese = driver.findElement(By.id("cheese"));
- 3. Locating by ID WebElement elem = driver.findElement(By.id("email"));
- 4. Locating by ClassName WebElement elem = driver.findElement(By.className("inputtext"));
- 5. Locating by Name WebElement elem = driver.findElement(By.name("userName"));
- 6. Locating by TagName WebElement elem = driver.findElement(By.tagName("strong"));
- 7. Locating by Link text WebElement elem = driver.findElement(By.linkText("REGISTER"));
- 8. Locating by Partial link text WebElement elem = driver.findElement(By.partialLinkText("STER"));
- 9. Locating by xpath WebElement elem = driver.findElement(By.xpath("//img[@src=’/images/hdr_right.gif’]"));
- 10. Locating by cssSelector WebElement elem = driver.findElement(By.cssSelector("input.inputtext[tabindex=1]"));
- 11. Xpath
- 12. Xpath Xpath - It is a syntax or language for finding any element on the web
- 13. Syntax
- 14. Types of X-path 1) Absolute XPath html/body/div[1]/section/div[1]/div/div/div/div[1]/div/div/div/div/div[3]/div[1]/div/h4[1]/b 2) Relative XPath. For Relative Xpath the path starts
- 15. 1) Basic XPath: Xpath=//input[@name='uid'] Xpath=//input[@type='text'] Xpath= //label[@id='message23'] Xpath= //input[@value='RESET'] Xpath=//*[@class='barone'] Xpath=//a[@href='http://demo.guru99.com/'] Xpath= //img[@src='//cdn.guru99.com/images/home/java.png']
- 16. 2) Contains(): Xpath=//*[contains(@type,'sub')] Xpath=//*[contains(@name,'btn')] Xpath=//*[contains(@id,'message')] Xpath=//*[contains(text(),'here')] Xpath=//*[contains(@href,'guru99.com')]
- 17. 3) Using OR & AND: Xpath=//*[@type='submit' or @name='btnReset'] Xpath=//input[@type='submit' and @name='btnLogin']
- 18. 4) Starts-with function: Id=" message12" Id=" message345" Id=" message0873" Id=" message8769" Xpath=//label[starts-with(@id,'message')]
- 19. 5) Text(): Xpath=//td[text()='UserID']
- 20. 6) XPath axes methods: a) Following - Selects all elements in the document of the current
- 21. Predicates
- 22. CSS
- 23. Css selectors When we don't have an option to choose Id or Name, we should prefer
- 24. Css selector and classes Log in WebElement ele1 = driver.findElement(By.cssSelector(".primary-btn")); WebElement ele2 = driver.findElement(By.cssSelector(".btn.primary-btn")); WebElement ele3
- 25. Special characters 1. '^' symbol, represents the starting text in a string. 2. '$' symbol represents
- 29. xpath or css
- 30. { table_header_id_and_class: { css: "table#large-table thead .column-50", xpath: "//table[@id='large-table']//thead//*[@class='column-50']" }, table_header_id_class_and_direct_desc: { css: "table#large-table > thead
- 31. Xpath vs Css XPath we can traverse both forward and backward Any set of conditions for
- 33. Скачать презентацию







![Locating by xpath WebElement elem = driver.findElement(By.xpath("//img[@src=’/images/hdr_right.gif’]"));](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-8.jpg)
![Locating by cssSelector WebElement elem = driver.findElement(By.cssSelector("input.inputtext[tabindex=1]"));](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-9.jpg)



![Types of X-path 1) Absolute XPath html/body/div[1]/section/div[1]/div/div/div/div[1]/div/div/div/div/div[3]/div[1]/div/h4[1]/b 2) Relative XPath. For Relative](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-13.jpg)
![1) Basic XPath: Xpath=//input[@name='uid'] Xpath=//input[@type='text'] Xpath= //label[@id='message23'] Xpath= //input[@value='RESET'] Xpath=//*[@class='barone'] Xpath=//a[@href='http://demo.guru99.com/'] Xpath= //img[@src='//cdn.guru99.com/images/home/java.png']](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-14.jpg)
![2) Contains(): Xpath=//*[contains(@type,'sub')] Xpath=//*[contains(@name,'btn')] Xpath=//*[contains(@id,'message')] Xpath=//*[contains(text(),'here')] Xpath=//*[contains(@href,'guru99.com')]](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-15.jpg)
![3) Using OR & AND: Xpath=//*[@type='submit' or @name='btnReset'] Xpath=//input[@type='submit' and @name='btnLogin']](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-16.jpg)
![4) Starts-with function: Id=" message12" Id=" message345" Id=" message0873" Id=" message8769" Xpath=//label[starts-with(@id,'message')]](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-17.jpg)
![5) Text(): Xpath=//td[text()='UserID']](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-18.jpg)









![{ table_header_id_and_class: { css: "table#large-table thead .column-50", xpath: "//table[@id='large-table']//thead//*[@class='column-50']" }, table_header_id_class_and_direct_desc: {](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1009679/slide-29.jpg)

Основы алгебры логики
Технология создания и обработки графической информации
Паттерны в программировании
Алгоритм подачи заявки на ПФДО
Информатика и информация
Программирование разветвляющихся алгоритмов
Детектирование объектов
Информационная безопасность в сети интернет
Typescript
Объединение сайтов
Защита информации
Система компьютерного моделирования процессов Полигон
Технология 3D принтинга
Теоретическое программирование
Национальный молодежный форсайт
TDD (test-driven development). Разработка через тестирование
Алгоритмы и структуры данных на Python. Специализированные коллекции
Рынок ценных бумаг и интернет
Python в качестве альтернативного языка обучения программированию
SHAZAMь, чтобы быть в ТАНЦАХ
Номинации лица в заголовках информационных ресурсов тut.by и 015.by: прагматический аспект
Технологии беспроводной связи
Международный день защиты информации
Технология CUDA
Наука информатика
Основные понятия автоматизации. Лекция 3
Машинное обучение. Лекция №4
Виды БД