jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

Get back the focus to the browser pop-up #107

Closed pgundlupetvenkatesh closed 8 years ago

pgundlupetvenkatesh commented 8 years ago

I am working on a modal dialog which helps me upload external files to a web-application. So far I am able to add an external file to the upload popup of the application. But, I am struggling to get back the control from Modal dialog to the upload pop-up. Here’s the locators for the popup div element

<div tabindex="-1" class="ui-dialog-buttons" role="dialog" aria-describedby=" uploadAttachmentsDialog" aria-labelledby="uid1" style="left: 338px; top: 223px; width: 600px; height: auto; display: block; position: absolute; z-index: 20002;">

By using the above “aria-labelledby” attribute I was able to get the pop-up and launch the modal dialog. But, after the modal dialog closes after selecting a file and clicking Open button, I am not getting the focus/control back to the popup. Can anyone please guide me on this. Following is how I have handled the modal

window = RAutomation::Window.new(:title => "Open", :adapter => :autoit) window.text_field(:ID => "1148").set "path_to_file" window.button(:ID => "1").click

pgundlupetvenkatesh commented 8 years ago

Got it working without "autoit" adapter.