Forum Discussion

AutoBot_1's avatar
AutoBot_1
Occasional Contributor
15 years ago

TC8.5: EvaluateXPath not working with IE

Hi,



I am trying to identify a web object using the Xpath function introduced in TestComplete 8.5



In the below code, I am trying to get the radio button on an airline site (aa.com) and then click it.

This piece works absolutely fine with Firefox browser but not with IE.



Is there something I am missing in case of IE ??

Please suggest a solution.



Here is the code:



Sub VerifyXpath()






  Dim objBrowser, objPage, objWebObject


  'set objBrowser = Sys.Process("firefox")

   set objBrowser = Sys.Process("iexplore")



  


  set objPage = objBrowser.Page("*")


    


  XPATH_STR = "//*[@id='flightSearchForm.tripType.oneWay']" 






  'Gets stuck at this point ---- 


  set objWebObject = objPage.EvaluateXPath(XPATH_STR)






  if Not IsNull(objWebObject) then


     objWebObject(0).Click

  else


    log.Message "Object Not Found" 


  end if






End Sub



Thanks,

AutoBot

12 Replies

  • vickywyy's avatar
    vickywyy
    New Contributor
    Hi, 

       I have also tried these pieces of code, but it seemed it did not work with TC8.6 and FF5.0.

       the result is Object Not Found.

     

       Sub VerifyXpath() 

      Dim objBrowser, objPage, objWebObject 

      set objBrowser = Sys.Process("firefox")

      'set objBrowser = Sys.Process("iexplore",1)

      set objPage = objBrowser.Page(http://www.aa.com/*

      objWebObject = objPage.EvaluateXPath("//input[@id='flightSearchForm.tripType.oneWay']") 

      if Not IsNull(objWebObject) then 

         objWebObject(0).Click

      else 

        log.Message "Object Not Found"  

      end if 

    End Sub

     

        but it worked with TC8.6 and IE7.

        could you help to have a check!

        thanks a lot in advance.