51Testing软件测试论坛

标题: 有谁对react了解吗 [打印本页]

作者: vincenthan    时间: 2016-12-1 09:48
标题: 有谁对react了解吗
据说用react就没有id了是吗?还如何用selenium测试?还能用吗?还是只是更麻烦了?如果不行还有其他的方法吗
作者: 104~牛牛    时间: 2016-12-2 10:30
var RadioButton = React.createClass({
14             render: function(){
15                 return (
16                     <label htmlFor={this.props.id}>
17                         <input type="radio"
18                                id={this.props.id}
19                                name={this.props.name}
20                                value={this.props.value}
21                                checked={this.props.checked}
22                                onChange = {this.handleChange}/>
23                         {this.props.text}
24                     </label>
25                 );
26             },


上面是ReactJS,写了一个RadioButtonList组件,由此可以看出组件的id、name还是有的,所以还可以用原来的定位方式定位你想要的控件

作者: vincenthan    时间: 2017-3-7 10:18
104~牛牛 发表于 2016-12-2 10:30
var RadioButton = React.createClass({
14             render: function(){
15                 retur ...

我们这开发说虽然是有id,但是应该是动态生成的一串字符串,无法用来进行识别了,因为不同环境的id会不同了,name有时候是不唯一的吧,是不是只能通过其他方式来识别呢




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2