code login gmail

 avatar
user_8607526207
python
2 years ago
1.5 kB
3
Indexable
Never
import uiautomator2 as u2
import time
d = u2.connect()
d.app_start("com.android.vending", use_monkey=True)
d.xpath('//androidx.compose.ui.platform.ComposeView/android.view.View[1]/android.view.View[1]/android.view.View[1]/android.view.ViewGroup[1]').click()
time.sleep(10)
d.xpath('//android.widget.ScrollView/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.view.ViewGroup[1]/android.widget.FrameLayout[2]').click()
d(resourceId="com.android.vending:id/0_resource_name_obfuscated", text="Quản lý Tài khoản Google của bạn").click()
d.xpath('//*[@resource-id="com.google.android.gms:id/account_spinner"]/android.widget.ImageView[1]').click()
d.xpath('//*[@resource-id="com.google.android.gms:id/list"]/android.widget.LinearLayout[1]').click()
d.xpath('//*[@resource-id="view_container"]/android.view.View[2]/android.view.View[1]/android.view.View[1]/android.widget.TextView[2]').click()
time.sleep(10)
d(resourceId="identifierId").click()
d.set_fastinput_ime(True)
print("Cho nhap email")
#d.(focused=True).set_text instead
d.send_keys("buivantien13112022@gmail.com", clear=True)
time.sleep(10)
d(text="Tiếp theo").click()
time.sleep(10)
print("Cho nhap mat khau")
d.set_fastinput_ime(True)
d.send_keys("cellphone18", clear=True)
time.sleep(10)
d(text="Tiếp theo").click()
time.sleep(10)
d(text="Tôi đồng ý").click()