- Selenium WebDriver Quick Start Guide
- Pinakin Chaubal
- 164字
- 2021-06-24 18:26:29
Customized CSS
Now that we have seen the customized XPath, it's time to look at customized CSS. Remember, CSS can be used only for forward traversal.
The following are some customized CSS examples that one can use while coding the program:
- Using the name attribute: input[name='username']. This CSS identifies the username. Notice there are no '//'s.
- Using the name and type attribute: input[type='password'][name='password']. This will identify the password textbox.
- Using the ID and class: form[id='loginForm'],form[id='loginForm'][class='navbar-form']. These two CSS selectors will identify the login form.
- Using the 'contains' clause: form[id*='Form']. This will identify the form since the ID of the form contains the text Form. Contains is indicated by '*' in CSS.
- Using the 'starts-with' clause: form[id^='login']. This will identify the form since the form ID starts with the text 'login'. starts-with is indicated by '^' in CSS.
- Using the 'ends-with' clause: form[id$='Form']. This will identify the form since the form ID ends with the text 'Form'. ends-with is indicated by '$' in CSS.
推薦閱讀
- Google系統(tǒng)架構(gòu)解密:構(gòu)建安全可靠的系統(tǒng)
- 操作系統(tǒng)基礎(chǔ)與實踐:基于openEuler平臺
- vSphere Virtual Machine Management
- Instant Optimizing Embedded Systems using Busybox
- Linux系統(tǒng)安全基礎(chǔ):二進(jìn)制代碼安全性分析基礎(chǔ)與實踐
- 嵌入式系統(tǒng)及其應(yīng)用(第三版)
- NetDevOps入門與實踐
- Kali Linux高級滲透測試
- 跟老男孩學(xué)Linux運維:Shell編程實戰(zhàn)
- 完美應(yīng)用Ubuntu(第2版)
- Android NDK Beginner's Guide
- Windows Azure實戰(zhàn)
- Linux從入門到精通
- Windows7系統(tǒng)維護(hù)百寶箱
- Drupal 7 Mobile Web Development Beginner’s Guide