[英]how to solve if a part of classname is dynamic in selenium with java?
(before refresh the page the image is having classname as shown as) (在刷新页面之前,图像具有类名,如下所示)
<div class="icon-image SL_AND_ROLL"></div>
after some event if we refresh the webpage the image classname is as(for dynamic image) 在某些事件之后,如果我们刷新网页,则图像类名为(对于动态图像)
<div class="icon-image CLOSED"></div>
there is no change in xpath before and after event and refresh the page 事件前后的xpath没有变化,并刷新页面
您还可以通过部分类名称来跟踪元素,例如
By.cssSelector(".icon-image")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.