Selenium Click on Bookmark in Browser's Bookmark Toolbar

4,330 views
Skip to first unread message

Nicholas Goolcharan

unread,
May 1, 2012, 10:13:28 AM5/1/12
to seleniu...@googlegroups.com

Is there anyway by which I can automate the following steps in Selenium / WebDriver

  1. open a page
  2. click on bookmarklet in browser toolbar (eg Pinterest Pin Button)
  3. fill up data in the form loaded into the page by said bookmarklet.

If the bookmarklet is not accessible as it is part of the browser/bookmark toolbar, is there a way in which I can inject the javascript into the page and have it execute using Java and Eclipse?

Tarun Kumar

unread,
May 2, 2012, 1:55:35 AM5/2/12
to seleniu...@googlegroups.com
You could try using AutoIT, though not sure how far it would get you.
I doubt if java script can control browser bookmark.

Jayaraman - Inspired to become Software Architect

unread,
May 2, 2012, 9:50:20 AM5/2/12
to seleniu...@googlegroups.com
Yes.. You can bookmark a page by selecting the option from right click context menu and pressing the key "m". Its a shortcut to achieve this and this can be done using Selenium Webdriver. After that, you have to use Autoit or Alert class to handle the browser dialog.
 
Please try this below code to simulate the first 2 steps.
 

Webdriver test = new FireFoxDriver();

test.get("URL");

Actions bookmark=new Actions(test);

bookmark.contextClick(test.findElement(Location Strategy))).sendKeys("m").build().perform();

HTH!!

 

Let me know if you face any issues on this.

 
Thanks,
Jay!!
 


 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/N40AZiJ_6i8J.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Mannava Siva

unread,
Jul 13, 2016, 4:13:09 PM7/13/16
to Selenium Users
Hi jay - i was not able to do it can you be more presize so i can follow up your steps.

David

unread,
Jul 14, 2016, 12:34:09 PM7/14/16
to Selenium Users
FYI, what Jay mentioned is just for creating the bookmark. After that, "clicking" the bookmark from browser toolbar or menu will require another tool besides Selenium. So only proceed if you are comfortable with using AutoIt, Sikuli, or some other tool to find and click the bookmark.
Reply all
Reply to author
Forward
0 new messages