openatx / facebook-wda

Facebook WebDriverAgent Python Client Library (not official)
MIT License
1.72k stars 266 forks source link

How to convert wda.Element Object to wda.Selector Object ? #93

Open tianlulu opened 4 years ago

tianlulu commented 4 years ago

Hi,I am a new learner to be here to learn how to use facebook-wda. Now I met a problem. The problem is when i use "elements =s(text='Dashboard').find_elements()" to get "Array of Element object",But i use "elements[0]" to call click() method like this "elements[0].click()". Because it's Element object. But we can use "element=s(type="Dashboard", textContains="房间")[0]" to call click() method like this "element.click()". Because it's Selector object. How to convert wda.Element Object to wda.Selector Object each other?

codeskyblue commented 4 years ago

wda.Element can not convert to wda.Selector

codeskyblue commented 4 years ago

s(type="Dashboard", textContains="房间")[0] looks better than s(text='Dashboard').find_elements()[0], but now just keep the way.