Forum Discussion

von_bailey's avatar
von_bailey
Contributor
13 years ago

Invisible or out of windows bounds

I have a script that works in Chrome but not in IE9.  Not sure why.  The problem object is visible on the screen and works perfectly when run in Chrome, but running the same script, in IE9 and the object cannot be found.  It displays the errors that it is "waiting for the window to activate" and then "Waiting until the overlapped window becomes visible".  However, the page appears active and while I'm not sure what "overlapped window" needs to become visible, the one that is needed to perform the actions coded is visible on the screen.



Attached is the code being used and a picture of the errors as they appear in the log.  It should be run against the following URL:



https://www.clublocal.com/tx/dallas-fort-worth/reviews



Start with the "dome" function.




function mainReviews(theBrowser,theEnv, all){


      // Activating the Reveiws pages


      var reviewPage=Sys.Browser(theBrowser).Page(theEnv+"/*").Header(0).Panel(0).Panel(0).Nav(0).Link(2)


      reviewPage.click(5,5) 


      Delay(2500)


      Log.Message("Generic Page")


      clickThrough(theBrowser,theEnv)


      var Reviews=Sys.Browser(theBrowser).Page(theEnv+"/*").Panel("stage").Panel(0).Panel(1)


      Delay(2500)


      // Flipping through the various services


      for(i=0;i<14;i++){ // This value must be changed to match the total services with reviews listed


            var Listing = Reviews.Link(i).contentText 


            Log.Message("Listing "+ Listing)


            Reviews.Link(i).click(3,3)


            Delay(2500)


            // Checking the paging


            var ckListing = Sys.Browser(theBrowser).Page(theEnv+"/*").Panel("stage").Panel(0).TextNode(0)


            ///Check if Listing is in the ckListing value.  If not it needs to record the problem and move on to the next link.


            listVerified=ckListing.Find("contentText","*"+Listing+"*")


            if(listVerified.Exists==false){


                  Log.Error("Failed to open the "+Listing+" Reviews Page")


                  continue;}


            clickThrough(theBrowser,theEnv)         


            }


      // Closing


      if(all==false){closeClass("Consumer Reviews Page Detail Test Complete")}


}


 


function clickThrough(theBrowser,theEnv){  // This function only occurs if the panel with the "Newer" and "Older" buttons is visible


   if(Sys.Browser(theBrowser).Page(theEnv+"*").Panel("stage").Panel(0).Panel(0).Panel(1).Visible==true){


          Sys.Browser(theBrowser).Page(theEnv+"*").Panel("stage").Panel(0).Panel(0).Panel(1).Panel(1).Click(5,5)


          Delay(2500)


          Sys.Browser(theBrowser).Page(theEnv+"*").Panel("stage").Panel(0).Panel(0).Panel(1).Panel(0).Click(5,5)}        


}


 


function dome(){


    mainReviews("iexplore","https://staging.clublocal.com",0)}



  • Step:-1 Launch the browser and type https://www.clublocal.com/

    Step:-2 Select Reviews Menu

    Step:-3 Get the List of "Reviews by Category" 

    Step:-4 Click a category

    Step:-5 Click older link if exist

    Step:-6 Click newer link if exist

    Step:-7 Repeat Step4 to step6 for each category



    Is this what you are trying to do? Let me know. if so, I would help you and give simple  script that does this.




    http://www.appcrowdtest.com:8082/issues/2 

    I would post the test complete project here.
  • It already does that in Chrome, it simply doesn't do it in IE9.  If you have a solution that will work in IE9 and Chrome that would be greatly appreciated.  
  • sonudavidson's avatar
    sonudavidson
    Occasional Contributor
    Hi Von,



    I just had a look at your problem. Its suspect that it might be a problem with the object browser of Test Complete. Try to use some refresh methods.



    Sys.Browser.Refresh

    Try using the above line.



    It may work then.
  • lordsivan's avatar
    lordsivan
    Occasional Contributor
    Here are few suggestion

    1. The Sys based alias is very fragile. Very soon, you would end up with code that is not maintainable



    2. Click based on co-ordinates is also fragile.. do not use them.



    3. You got to wait for the page to load completely.



    TestCase:- http://www.appcrowdtest.com:8082/issues/2

    TestComplete Test code:- http://www.appcrowdtest.com:8082/issues/4

    TestReport:-http://www.appcrowdtest.com:8082/issues/3





    Hope it helps. For the below code to work you need complete project







    Here is my script that take care of both the issues




    function TestRunScript()


    {


      //The beginning of the Step-1 Goto the website group


      Log.Message("Launch Browser", "");


      Browsers.Item(btIExplorer).Run("");


      Browsers.Item(btIExplorer).Navigate("https://www.clublocal.com/");


      //The end of the Step-1 Goto the website group


      //The beginning of the Step-2 Click Reviews group


      Log.Message("Click Review", "");


      Aliases.Browser.Page_ClubLocal.Panel_Header.Panel_Menu.Link_Reviews.Click();


      //The end of the Step-2 Click Reviews group


      //The beginning of the Step-3 Click Review Catergory group


      Log.Message("Wait for page to load", "");


      Delay(5000);


      WaitForObjectToAppear(50000, Aliases.Browser.Page_ClubLocal.Page_Reviews.Panel_Right, "Page load failed");


      clickLink("Heating & Air Conditioning", Aliases.Browser.Page_ClubLocal.Page_Reviews.Panel_Right);


      //The end of the Step-3 Click Review Catergory group


      //The beginning of the Step-4 Click older group


      Log.Message("Click The older", "");


      Aliases.Browser.Page_ClubLocal.Page_Reviews.Panel_Pagination.Panel_Older.Click();


      //The end of the Step-4 Click older group


      //The beginning of the Step-5 Click Newer group


      Log.Message("Click Newer", "");


      Aliases.Browser.Page_ClubLocal.Page_Reviews.Panel_Pagination.Panel_Prev.Click();


      //The end of the Step-5 Click Newer group


    }