Question

I'm trying to automate some testing for our website using Selenium IDE. I'm pretty new to Selenium IDE so please forgive me.

We're using highcharts to display some data, but I'm not sure how highcharts is doing things. We have 3 div objects on the webpage for the charts. However, the id for the div obj changes and I don't know how to deal with it if I'm looking for this particular element.

There's a lot of HTML to cut and paste so I'll just put the div objects, which I think are the most important part of this. So the charts show up in each div object.

For example, in the HTML source, this is how the div objects look like

<div id="numRecs" data-highcharts-chart="3">
   <div class="highcharts-container" id="highcharts-6">
   </div>
</div>

<div id="activeStream" data-highcharts-chart="1">
   <div class="highcharts-container" id="highcharts-2">
   </div>
</div>

<div id="delay" data-highcharts-chart="2">
   <div class="highcharts-container" id="highcharts-4">
   </div>
</div>

So the (div class=highcharts-container id=highcharts-4) changes each time we access the webpage. One time it might be -4, next time it might be -0, etc. The (data-highcharts-chart=2) also changes too but I don't think that's as important since it doesn't affect me looking for div id=delay.

I've also tried right clicking on the object from the browser but it says it's css=svg > rect, which fails too. How can I tell Selenium IDE to check if the parent div (div id=delay) has children? I'm hoping that looking for the existence of children will solve my problem. Thanks in advance for your help.

Was it helpful?

Solution

You can use verifyElementPresent command to check if specific UI element exist on the page. So to check if a parent div (with id='delay') has children div you can just put as a target //div[@id='delay']/div

You can read more about this in the Selenium IDE documentation: http://docs.seleniumhq.org/docs/02_selenium_ide.jsp#verifying-page-elements

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top