-1

I am trying to find out the Total number of flight details been displayed in a particular search. I used Xpath which works, but not fully. Now I wanted to use JavaScript code from the site.

Please see:

a style="color:#FF0099;cursor: pointer;" title="Click here for Flight details"
    onclick="javascript:showDiv(this,'flightdetail28','28','6a7891beb531878bce3246240a2a9e63')

Now I just wanted to know how many flights are been displayed, like the above as flightdetail28.

Please suggest: How to use the JavaScript code and implement it in my Selenium RC.

Petr Janeček
  • 37,768
  • 12
  • 121
  • 145

1 Answers1

0

Is flight details in a table if so then use storeXpathCount function in Selenium IDE and provide the xpath like this //table/tbody/tr.

storeXpathCount //table/tbody/tr aa echo ${echo}

Atin
  • 380
  • 1
  • 5
  • 10
  • @ Atin: It is in Div tag. I am confused to use the JavaScript code. Also I have used Xpath but it fulfills only 1 requirement, So I require your suggestion in JavaScript. – Tester001 Mar 14 '12 at 15:17
  • Can you please share the full Xpath for the table on which all the Flights are displayed? I guess you want the count of available flights..right? – Atin Mar 19 '12 at 07:57
  • Yes you are right. xpath:.//*[@id='myTbody'] If you want to see the site you can see "http://www.flightnetwork.com" select One way, from: Toronto to Delhi, Date: 10/31/2012, Press Enter. The Result page link should be "http://www.flightnetwork.com/flights/fares". On this page I need to calculate the total number of flights. – Tester001 Mar 19 '12 at 08:48
  • Here is the solution: storeXpathCount //table/tbody[@id='myTbody']/tr[@valign='top'] aa echo ${aa} – Atin Mar 19 '12 at 10:17