Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98784

How to identify webelement with dynamic id and name?

$
0
0

I can't define webelement as it has dynamic id and name. There are iframe in another iframe. Attributes id and name for second iframe are dynamic. I need to define the second iframe to switch on it http://prntscr.com/pqshpr Please help me with defining this dynamic elements.

 WebElement chartFrameFirst = driver.findElement(By.xpath("(.//iframe)[1]"));
    driver.switchTo().frame(chartFrameFirst);
    click(By.xpath(".//div[@id=\"tv_chart_container\"]"));
    WebElement chartFrameSecond = driver.findElement(By.xpath(".//iframe[@id=\"tradingview_1d329\"]"));
    driver.switchTo().frame(chartFrameSecond);

Viewing all articles
Browse latest Browse all 98784

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>