Forum Discussion

someshg2's avatar
someshg2
Occasional Contributor
13 years ago

Cross browser testing code implementation for IE,Firefox and chrome


Hi,


This is regarding the cross browser code implementation with Testcomplete 8.7. We have written code for IE like as below and want to run the same code with Mozilla Firefox (v10.0) and Google Chrome(v17.0) . But some objects are identified with different ID’s from IE to Firefox and Chrome. So our scripts are got failed. 

 


Browser=”IEXPLORE”

Sys.Process(Browser).Page("*").document.all.Item("X_").Click()


Item("X_") is showing on FF and chrome as item(63).




Why they are being different for IE to Firefox and Chrome when basically it supports crossbrowser testing? How do we handle the above problem?

2 Replies

  • If you are sure that there is no object Item("X_") in object tree for FF and Chrome, then it is likely that web pages are different in IE and other browsers - you can check this by comparing web page source in these browsers. Even if this is TestComplete bug, you can use Page("*").NativeWebObject.Find or Page("*").EvaluateXPath method to find the needed object.
  • I've been using



    Sys.Process(Browser).Page("*").contentDocument.getElementById("X_")



    and it's been working fine in IE and Chrome. I haven't tried it in FF yet though.