This is a script on app automation that I am executing on BrowserStack.
Here is my code:
from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
userName = "xxxxx"
accessKey = "yyyyy"
desired_caps = {
"build": "Python android login",
"device": "Samsung Galaxy S8 Plus",
"app": "bs://e761bd35add7e1da33f6a4c480bf91a96dcd3382",
'autoAcceptAlerts': 'true',
'name' :'App test2'
}
try:
driver = webdriver.Remote("https://" + userName + ":" + accessKey + "@hub-
cloud.browserstack.com/wd/hub", desired_caps)
driver.implicitly_wait(30)
driver.find_element_by_xpath("//oj-button-text[contains(text(),'Agree')]").click()
driver.find_element_by_id("oj-button-1401427062-1|text").click()
print("Click completed on agree buton")
except:
raise
Here are the properties:
Button | Properties |
---|---|
Name | SPAN |
Type | 1 |
Id | oj-button-1401427062-1 |
Class | oj-button-text |
Text | Agree |
X | 854.6563110351562 |
Y | 2079.0 |
W | 207.34375762939453 |
H | 41.000000953674316 |
BgColor | rgba(0, 0, 0, 0) |
Visibility | visible |
Display | inline |
Overflow | hidden |
Position | static |
CssSelector | #oj-button-1401427062-1 |
Xpath | //span[@id="oj-button-1401427062-1 |