Forum Discussion

vickywyy's avatar
vickywyy
New Contributor
15 years ago

TC8.6: EvaluateXPath does not work in FF5.0


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.





P.S my refernce thread is here: TC8.5: EvaluateXPath not working with IE 

       http://smartbear.com/forums/forum/post/?mode=singleThread&thread=86ccebf7-c3e9-4e83-bbc1-de4f4c0affc4

4 Replies

  • Vicky,


    I'd suggest typing the element name in upper case (i.e. INPUT instead of input) and the attribute name in the way it is specified in the page sources. These are requirements mentioned in the EvaluateXPath method description.


    I checked your code and failed to reproduce the problem. I tried TestComplete 8.60 with IE8 and FF7, and these versions of the browsers are later than those you used. However, I suppose, everything should work fine in earlier versions too. So, if you address the appropriate browser process (the process index may change depending on the tab) and if the page contains the INPUT element with attribute id="flightSearchForm.tripType.oneWay", this code should be able to find the element. Could you please check if the element exists on the page?


    Also, what kind of pages are you testing? I ask about this, because the element may be generated dynamically and you need to pause your test a little until the element appears on the page and TC updates the hierarchy of test objects. To pause the script, you can use the aqUtils.Delay method. To command TestComplete to update the object hierarchy, use Page(...).Refresh.

  • vickywyy's avatar
    vickywyy
    New Contributor
    thanks Alex

    I have also tried my codes with TC8.6(with FF7 patch) and FF7, and it works fine.



    i don't know what's wrong with TC8.6 and FF5.



    anyway, thanks a lot for your info.
  • Hi Vicky,



    So, will you keep working with Firefox 7 or do you want us to investigate the behavior you observed with Firefox 5 further? If you're interested in investigating the behavior you faced with Firefox 5, please contact us via our Contact Support form.
  • vickywyy's avatar
    vickywyy
    New Contributor
    Hi, Allen

        I think FF7 is fine for me by now.

        and if there is any further issue, i will contact the support.

        thanks a lot!