开发者

Selenium regex question

Im trying to automate the creation of a customer on the project im currently workin on, using selenium. (note, so far im only using selenium's own ide, not through java or anything else) The problem im having is that the panel i use to fill in the details is not recognised on playback of the script. This is because the panel gets a new id ev开发者_运维知识库ery time it is generated, and selenium is looking for the old one. I wanna know can i use regex somehow to match the pattern of the id instead of the actual id?

The ID looks something like this: P_0500A_72_4_P its only the 4 that increments. and if a new browser session is started it resets to 72_0 and begins to increment again.


You have not mentioned what element the panel is. Assuming this to be a div, your html element should be something like given below

<div id="P_0500A_72_4_P">
<div id="P_0500A_72_5_P">

To identify the div use the following xpath:

"//div[contains(@id,'P_0500A_72_')]"

This xpath will select the element which has P_0500A_72_ in its ID.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜