Forum Discussion

Nishi's avatar
Nishi
Contributor
13 years ago

Accessing Dates on a Calendar Image - IE9 and TC9

Our application publishes(from browser) files into various folders.



Each file has a publish date - these dates are automated and they used to work fine.

I am running into issues where dates on getting selected afte selecting a month and year.



Calendare Image



<Prev>   Current Month-Year  <Next>

1 2 3 4 .....

...

23 24 25 26 27 28 29 30



Here I am able to select prev and traverse correctly to the month.

But the code which selects month is failing (note this used to work perfectly on IE8 and TC8)



My code sample is here:



function clickDate(date,format,page,monthNum)   //Click the date on calendar

{

   yearNow = aqDateTime.GetYear(r2wdate);

   monthNow = aqDateTime.GetMonth(r2wdate);

   yearFinal = aqDateTime.GetYear(format);

   monthFinal = aqDateTime.GetMonth(format);

   var yeardiff = aqConvert.IntToStr(yearNow) - aqConvert.IntToStr(yearFinal);



...................

if(monthdiff > 0){

      counter = 12*yeardiff + monthdiff;

      for (i =1;i <=counter;i++){

        page.NativeWebObject.Find("title","Previous month","IMG").Click();

      }

     var date1 = page.NativeWebObject.Find("innerText",date);



     <<<< FAILS HERE >>>> values = date1.parent.FindAll("innerText",date); <<<<<<<<<<



     values = VBArray(values).toArray();                

     for (var i=0; i<values.length; i++){

        if (values.outerHTML.indexOf(format) != -1){

          value = values;

          break

         }

      }                        

      value.Click();

      }

....

}



Thanks for any suggestions,

1 Reply


  • Hi Nishi,


     


    What exactly doesn't work? Are you getting an error when executing the problematic line?


    Try debugging your test to determine what can be wrong. Can you attach the HTML source of your page?