mercredi 26 avril 2017

Python-Selenium-Chrome minimized window is maximizing itself

I am using Selenium with chromedriver in Python for testing 2 functionalities in parallel. Basically my webpage have 2 dropdown menus. Choosing an option from any dropdown menu will download a file. I have 2 scripts testing both dropdown menus separately. Now let say script-1 opens chrome and load the webpage. Now script-1 opens the dropdown-1 and it is in process of selecting an option from it as per the given input. During this if I navigate away from opened webpage to any other window eg. file explorer, the dropdown will get close without choosing the option and test case hangs. Also if I minimize the window before the dropdown is opened, the window will reopen itself when option is clicked for downloading the file. How can I stop the window from re-opening. Is there any Chrome setting for this?

Even if I move away from computer during execution, I want to run both the scripts in parallel side by side as they both open separate windows but after sometime one of them hangs the other window and I have to manually click on dropdown to bring it back to life. I am planning to run the scripts using multithreading with 2 threads referring to each of the scripts.

Note : I cannot use urlretrieve as there is no pre-defined URL for the files in webpage. PhantomJS do not support file download.

Aucun commentaire:

Enregistrer un commentaire