Answered

Not able to locate the circle in the check in graph

Hi Team, 

We have to validate Check-in History List screen by clicking the circle(hyperlink) in the Check-in graph.

Tried with this locator initially ( //*[local-name()='svg']//*[local-name()='circle' and @id='ext-gen300'] ) in 95th step. It get passed for the first time and second run it get failed.

Then subject7 suggested the locator ((//*[local-name()='svg']//*[local-name()='circle' and @cx='178.20833333333334' and @cy='38' and @r='4']) we have tried this in our two sites. 

In https://onshoreautomation.mosoqa.com, its working for the first time and then it fails at second time.

In https://offshoreautomation.mosoqa.com, its getting failed for the first time itself.

Please help us to solve this issue

Exec Id: 10559

Name: column_history

Thanks

0
7 comments
Avatar
Rex Feizi

Hi. 

Please provide the following on this post: 

 

  1. Provide the DOM snippet (around the target element) on both systems (i.e. offshore and onshore). 
  2. When you refresh the page, does the value of the HTML attributes that you have in the XPath change? i.e.  cx='178.20833333333334' and @cy='38' and @r='4'
0
Comment actions Permalink
Avatar
Gayathri

Hi,

1. I have attached the DOM snippet for both sites.

Offshore- First run

 

Onshore- First run

2. Yes the value changes after refresh.

Offshore - After reloading page

Onshore - After reloading page

Thanks.

0
Comment actions Permalink
Avatar
Rex Feizi

Perfect illustration thank you, wish everyone would follow your lead on this detailed form of posting :) 

 

Basically, as you mentioned yourself, the values of the HTML attribute changes and as since the XPath is dependant on the attribute values, it won't hold on the consecutive runs. Therefore, we need to find some other "anchor"/information so that we can create our locator (i.e. XPath) from that. 

All the colors are the same on the graph and most "stroke" values and "stroke-width" are also pretty much the same. 

Can you share which part of the graph are you trying to click? For example, is it the highest point, or the outmost left, any information can help.     

0
Comment actions Permalink
Avatar
Gayathri

Hi,

We want Total graph which is in Blue color, need to click any circle in that graph. So that another screen named Check-in History List may pop-up. We have to validate the fields in the pop up screen. 

So no issues if its highest point or the the outmost left. By clicking any circle in the Total graph,the another screen will pop-up. 

Thanks. 

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Gayathri,

Would you please try the below solution:

1- After step  (moso_checkin.link.ClickTotalGraph), add new step with Get_Web_Value command and click Javascript as Source Type

2- Enter the value "highest_y" as variable name

3- In the Script section, add this script:

var count =  document
.evaluate( "//*[contains(@class, 'highcharts-series')][@visibility='visible']" ,document )
.iterateNext()
.childElementCount - 5;var y_cordinates = [];
var xpath = document
.evaluate( "//*[contains(@stroke, '#FFFFFF')][@cy]" ,document );
var child = xpath.iterateNext();
while (child){
y_cordinates.push(child.getAttribute("cy"));
child = xpath.iterateNext();
}
return Math.ceil(Math.min(...y_cordinates));

4- In the step that double clicks on circle (moso_checkin.cell.CircleClick), use the XPath below:

//*[contains(@stroke, '#FFFFFF')][@cy >= 0][@cy <= @highest_y][1]

Please let us know how it goes. This was tested on both 'onshoreautomation' and 'offshoreautomation' data sets and it's working.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Gayathri

Hi Team,

Tested for more than 3 runs in both sites (onshoreautomation and offshoreautomation). Its working fine. 

Able to click on the graph, so that the"Check-in History List" screen displays.

Thanks a lot.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Gayathri,

Great news, thank you so much for the feedback.

Regards,

Subject7 Team

0
Comment actions Permalink

Please sign in to leave a comment.