The way I am able to do that now is by manually clicking the instance of Chrome -- otherwise, the tests do run, I just dont see them taking place.You need to introduce a library that is able to automate actions on an OS level.Looks like youre using Java, so you could take a look at awt.Robot.But be aware that any solution you come up with using Robot will likely be finicky.
It just changes which browser window selenium sends its actions to. Selenium is able to communicate with browser windows that are hidden behind other windows on your screen. For other users out there looking for a solution, you can find it below (see Soorajs answer). I think you can also use java script executor to pop up an alert so that browser comes to focus before each test suite. When we launch the url, Chrome window was sent to background. Is There A Python Equivalent To Java'S Awt Robot Class Code And ItTo overcome this issue, we have used the following code and it works like magic. My solution is to use JavascriptExecutor (my code is all c). Provide details and share your research But avoid Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. Is There A Python Equivalent To Java'S Awt Robot Class Driver Java BrowserNot the answer youre looking for Browse other questions tagged selenium-webdriver java browser-automation chrome or ask your own question.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |