iThink icon indicating copy to clipboard operation
iThink copied to clipboard

react native vs Appium

Open hufeng opened this issue 8 years ago • 0 comments

Appium暂时不支持tag的方式

先通过accessibilityLabel来定位app中的元素

import React, {Component} from react
import {View, Text} from 'react-native'

export default class HelloApp extends Component {
  render() {
    return (
      <View 
           accessible={true}
           accessibilityLabel={"helloapp:text-label"}>
         <Text>hello world</Text>
      </View>
   )
  }
}

test code

def test_find_elements(self):
   sleep(5)
   user_input = self.driver.find_element_by_accessibility_id("helloapp:text-label")

为了测试的方便,android版本继承Stetho image

hufeng avatar Sep 14 '16 05:09 hufeng