开发者

Selenium IDE: Problem to record input value with dynamic security prefix

开发者 https://www.devze.com 2023-04-06 05:17 出处:网络
I want to use selenium to record and click at item in a page with the following code: <input t开发者_运维技巧ype=\"checkbox\" onclick=\"HighlightRow(1, this, 3,\"\");\" value=\"916242540932034325|

I want to use selenium to record and click at item in a page with the following code:

<input t开发者_运维技巧ype="checkbox" onclick="HighlightRow(1, this, 3,"");" value="916242540932034325|628149" name="AID">

in Selenium IDE, recorded script:

click
//input[@name='AID' and @value='916242540932034325|628149']

However, the value 916242540932034325|628149 having security prefix "916242540932034325" which will change dynamically every time the page load.

Problems: My Recorded Script not able to RUN after page load due to the dynamic security prefix.

Help: Anyone have any suggestion for the problems I face above?


Try click //input[@name='AID' and contains(@value, '|628149')]. As long as that's a unique combination of NAME and VALUE, you'll get what you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消