watir

Controlling a Firefox Extension via Javascript

被刻印的时光 ゝ 提交于 2019-11-27 09:08:48
Is it possible, using javascript, to control an overlay firefox extension? I've extracted the contents of the extension and have identified what functions/methods I need to run, but they are not accessible within the scope of the console. Thanks in advance for any ideas. Yes it possible to interact with other add-ons, given the right circumstances. My test case here will be com.googlecode.sqlitemanager.openInOwnWindow() , which is part of the SqliteManager addon . In newer builds (I'm using Nightly), there is the Browser Toolbox . With it is is as simple as opening a toolbox and executing com

Setting browser window size in Watir-webdriver

空扰寡人 提交于 2019-11-27 01:20:32
问题 How can you specify the size of the browser window opened when you call the following with watir-webdriver? browser = Watir::Browser.new(:firefox) 回答1: This works only for Firefox at the moment: browser.window.resize_to(800, 600) and you can move the browser, too: browser.window.move_to(0, 0) 回答2: I'm using ruby+watir-webdriver and this code works for both FF and IE browsers (I have not checked in others browsers) screen_width = browser.execute_script("return screen.width;") screen_height =

Disable chrome download multiple files confirmation

孤人 提交于 2019-11-26 22:01:15
问题 I developed a crawler with ruby watir-webdriver that downloads some files from a page. My problem is that when I click to download the second file, Chrome opens a bar in the top asking for confirmation that I am downloading multiple files from this website. Once this is used by webdriver, I cannot confirm the download. Is there anyway to avoid this confirmation? I am thinking if is there any configuration to avoid it or if is there an extension to do this or even if I can click on the

Controlling a Firefox Extension via Javascript

我们两清 提交于 2019-11-26 14:31:46
问题 Is it possible, using javascript, to control an overlay firefox extension? I've extracted the contents of the extension and have identified what functions/methods I need to run, but they are not accessible within the scope of the console. Thanks in advance for any ideas. 回答1: Yes it possible to interact with other add-ons, given the right circumstances. My test case here will be com.googlecode.sqlitemanager.openInOwnWindow() , which is part of the SqliteManager addon. In newer builds (I'm

How to find out which JavaScript events fired?

大城市里の小女人 提交于 2019-11-26 00:46:40
问题 I have a select list: <select id=\"filter\"> <option value=\"Open\" selected=\"selected\">Open</option> <option value=\"Closed\">Closed</option> </select> When I select Closed the page reloads. In this case it shows closed tickets (instead of opened). It works fine when I do it manually. The problem is that the page does not reload when I select Closed with Watir: browser.select_list(:id => \"filter\").select \"Closed\" That usually means that some JavaScript event is not fired. I can fire