简体   繁体   中英

How to access firebug in Selenium webdriver

I am new to Selenium webdriver,so don't know how to proceed on a requirement. Requirement states :

  1. Click on the note icon, a pop up 'note' opens up. Open the firebug in the pop up.
  2. Click on script option in the firebug, select note.js and search for window.close.

  3. Right click on window.close and select set Breakpoint option. (This ensures the pop up does not get closed once we save the note)

  4. Add a note and click on save. (The pop up remains open)
  5. Navigate to script option in the firebug and click on blue triangular icon.
  6. Navigate to console option in the firebug, right click on the POST request and select Copy Location with Parameters option.
  7. Navigate to script option in the firebug and click on blue triangular icon again. 'note' pop up gets closed.

Is it possible if we can accomplish the above tasks by using selenium webdriver. (I am using Java for script writing)

Thanks in advance.

You can create your profile in code and dynamically add required add-ons. Let's assume that you saved Firebug XPI into the C:\\FF_Profile folder as firebug.xpi ( go to Firebug download page , right-click on the "Add To Firefox" and save as C:\\FF_Profile\\firebug.xpi).

In code:

   final String firebugPath = "C:\\FF_Profile\\firebug.xpi";
   FirefoxProfile profile = new FirefoxProfile();       
   profile.addExtension(new File(firebugPath));
   // Add more if needed
   WebDriver driver = new FirefoxDriver(profile);

This is described in WebDriver FAQ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM