Launch the browser and open application URL (e.g. google.com)
Once page loads, hit the tab key and verify that the first element in focus is ‘xx’ element
I have used WebUI.sendKeys(findTestObject(‘Object location’), Keys.chord(Keys.TAB)) many times with success. But here I cannot focus on the URL and hit tab
I like @Elly_Tran’s idea of using “switchToWindowIndex(1)”, and then return to the original page, “switchToDefaultContent()”, but I was not able to find any information on the method, getFocusedElement(). Otherwise, I think this would be the easiest way to go about your concern.
Doing something a user would never do is decidedly not cool. And loading another page/window and then switching between them? Terrible idea. Even if you get this to “work”, what is it testing? What does the result even mean? Answer: It works as long as you do weird things no one would ever do.