我想点击+
图标,其状态名称的属性为data-stateid=1
,
但是当我尝试使用firepath
找到网页元素时
所有+
图标都与class
具有相同的属性,因此,我无法点击特定的+
图标。
HTML代码:
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#lob1" data-stateid="1">
<span class="tag tag-default tag-pill pull-xs-right">0</span>
<i class="fa fa-plus pull-xs-right btn-country-list" onclick="GetLobPopUp('AL','Alabama')"/>
</h4>
</div>
<div id="lob1" class="panel-collapse collapse in" style="height: auto;">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#lob3" data-stateid="3">
<span class="tag tag-default tag-pill pull-xs-right">0</span>
<i class="fa fa-plus pull-xs-right btn-country-list" onclick="GetLobPopUp('AZ','Arizona')"/>
</h4>
</div>
<div id="lob3" class="panel-collapse collapse in" style="height: auto;">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#lob4" data-stateid="4">
<span class="tag tag-default tag-pill pull-xs-right">0</span>
<i class="fa fa-plus pull-xs-right btn-country-list" onclick="GetLobPopUp('AR','Arkansas')"/>
</h4>
</div>
有人可以帮我解决这个问题吗? 最诚挚的问候。
答案 0 :(得分:3)
您需要做的就是首先使用不同的属性识别元素..如果您不能使用-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
cel = ....
cell.cellCallBackMethod = ^(NSInteger cellIndex)
{
[self cellButtonTappedFromCellWithIndex:cellIndex];
};
return cell;
}
-(void)cellButtonTappedFromCellWithIndex:(NSInteger )cellIndex
{
[self performSegueWithIdentifier:@"segueIdentifier" sender:nil];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier]isEqualToString:@"segueIdentifier"])
{
ViewController1 *vc = [segue destinationViewController];
}
}
,那么请使用class
:
data-stateid
答案 1 :(得分:2)