Forum Discussion

svishwakarma's avatar
svishwakarma
Occasional Contributor
4 years ago

Issue with virtual browser

Actually I recorded a script in browser maximum size and try to run same script in virtual browser then I am getting error.

Basically I need to run my script for mobile browser so I need to create a separate script for mobile browser or I can run same script on mobile browser (virtual browser). 

 

Please suggest me.

Thanks in advance.

Sandip

 

 

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Sandip,

     

    Generally speaking, good test code can be executed against any browser.

    However, the primary difference between desktop and mobile web pages for the same web application is that different page layout can be used for mobile and desktop ones. And this must be accounted in the test code. The most obvious example: while desktop web page may have a main menu strip, mobile page, most probably, will have not a main menu strip but 'hamburger' icon with drop-down elements of main menu.

    Additionally, web application may have some specifics to operate as required under different browsers. If this is the case then test code must also handle this.

     

    P.S.

    > in browser maximum size

    I never understood the idea behind tests execution in maximized browser...

     

  • ApplePen's avatar
    ApplePen
    Community Leader

    As Alex said the page layout maybe different between pc and phone.

    I think avoid use the layout to locate element in pages.

    Use xpath or CSS if the element has the same identifier like id in my opinion.

     

    AlexKaras  About browser maximum size

    I met the same problem.

    Sometimes elements probably doesn't appear in the page when the browser is not in maximum size.

    At the same time, the element cannot be found in Object Browser. I know less front end technology.

    So, I don't know how to use JS to operate it. Making the browser maximum size is the simplest way to do it.

    Another scene is to check image whether is displayed.

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      ApplePen :

      Hi,

       

      Sometimes elements probably doesn't appear in the page when the browser is not in maximum size.

      Agree. But at the same time, I've seen a lot of cases when page that looks good in maximized browser (read - in a big enough viewport) becomes visually corrupted on a smaller viewports.

      And also, if something is not visible on the page in a smaller viewport and I don't have any hint that this something must be present, how I as a user can get an idea that this something must exist and can be used? Personally I consider such page design to be a bad user experience.

      And, finally, personally I used to use windowed but not maximized browsers. (And been a test engineer, I am always happy to see corrupted page layout in a windowed browser. 🙂 )

       

      • ApplePen's avatar
        ApplePen
        Community Leader

        AlexKaras Your opinion that inspired me. Thanks a lot.

        We definitely need to stand as a user to test.

        Sometimes, we make automation test cases and ignore that.

        I will pay more attention for it later.

         

        About the browser size:

        Do you have any suggest how to design it in test?

        Ex. Do we test all cases in normal size and retest them in another size?