Forum Discussion

josette_merhy12's avatar
josette_merhy12
Occasional Contributor
10 years ago

TC 10.20 Firefox 29, object is null

i m searching for 2 objects inside a parent using find method. in chrome it is working great. but with firefox it is returning does not exist when searching for the second object.



here is an example:



function incrementNumber(valIndex, variable, obj, StepValue)

{

  var counter,counterIndex;

  var ObjButton,ObjButtonDecrement;

  var inputValue,document, ngModelString,element,scope;

 

  document = page.contentDocument;

 

  ObjButton = obj.Find("class","increment_bsy" ,1000);

  ObjButton.Click(10,10);

  Delay(1000);

  ObjButtonDecrement = obj.Find("class","decrement_bsy" ,1000);

  ObjButtonDecrement.Click(10,10);



}





in FireFox ObjButtonDecrement is always does not exist object as for Chrome it is working fine.

obj is null when ObjButton is clicked.



can anyone help me understand what is wrong with this code on firefox?

4 Replies

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    Are you sure this actually exists in Firefox?

    ObjButtonDecrement = obj.Find("class","decrement_bsy" ,1000);

    Several controls may actually differ in Firefox, be missing properties, or may not carry the same property values as Chrome.

  • josette_merhy12's avatar
    josette_merhy12
    Occasional Contributor
    yes i m sure it exists. the problem is with the parent being null after the first click on the ffirst object foud.
  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    Ok. And if you don't click the control does it change the behavior at all?

    In other words...does it dispose of the parent object after you perform this click.

    If you do not click the first child object does it produce differing results?





    function incrementNumber(valIndex, variable, obj, StepValue)

    {

      var counter,counterIndex;

      var ObjButton,ObjButtonDecrement;

      var inputValue,document, ngModelString,element,scope;

      document = page.contentDocument;

       obj.Refresh(); //troubleshooting

       Delay(1500);

      ObjButton = obj.Find("class","increment_bsy" ,1000);

      //ObjButton.Click(10,10);

      //Delay(1000);

      ObjButtonDecrement = obj.Find("class","decrement_bsy" ,1000);

      ObjButtonDecrement.Click(10,10);

    }





    Hope this helps to narrow it down!
  • josette_merhy12's avatar
    josette_merhy12
    Occasional Contributor
    yeah it is working... but y? what the reson behind this disconnection of the object in firefox?



    anyway s thank you