简体   繁体   中英

How to get xpath for dynamic iframe?

在此处输入图像描述

Hello, In the below application, the CVV is within an iframe(as shown in the attached screenshot) and the iframe xpath is dynamic in nature. I tried to use the below xpath, but it fails as the digits keeps changing. Could u please help on how to handle this dynamic iframe xpath?

//iframe[@id='cardinal-stepUpIframe-1586884117320']

You can use the start with in xpath or css as shown below.

Xpath

//iframe[starts-with(@id,'cardinal-stepUpIframe-')]

CSS:

iframe[id^='cardinal-stepUpIframe-']

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM