> []Selenium
===
## Table of Contents
[TOC]
## Tìm theo nhiều thuộc tính:
"//div[@class = 'vi-badge' and @elementtiming = 'element-timing']"
## Tìm theo nhiều element
//input[@name="username"] | //input[@id="wm_login-username"]
"//*[contains(text(), 'bạn đang nghĩ gì thế?')] | //*[contains(text(), 'on your mind')]"
## Tìm theo text:
'//*[ text() = "Not now" '
## Tìm chứa nội dung
chrome: '//*[contains(text(), "Edit profile")]'
android: "//*[contains(@text,'{ads_info}')]"
## Tìm theo thuộc tính và text:
'//span[@class="jsx-4172176419 day valid" and text()="23"]'
## Di chuyển đến element hoặc hold element ví dụ như thả tim
ActionChains(self.driver).move_to_element(apply).perform()
def convert_path(path):
path = path.replace("\a", "\\a")
path = path.replace("\t", "\\t")
path = path.replace("\r", "\\r")
path = path.replace("\n", "\\n")
path = path.replace("\f", "\\f")
path = path.replace("\v", "\\v")
path = path.replace("\b", "\\b")
return path