简体   繁体   English

有没有办法点击我刚刚使用 java/selenium 安装的 chrome 扩展?

[英]Is there a way to click on the chrome extension i just installed using java/selenium?

I am automating my test case where I need to install an extension and click on it and perform some action after that.我正在自动化我的测试用例,我需要安装一个扩展并单击它并在此之后执行一些操作。 I am able to install the plugin but not able to click on the same since selenium/ LeanFT isn't allowing me to do so.我可以安装插件,但不能点击它,因为 selenium/LeanFT 不允许我这样做。 Please suggest how do I do that?请建议我该怎么做?

What I have tried - Actions class in java to click on x,y coordinates - not helping me!我尝试过的 - java 中的操作 class 以单击 x,y 坐标 - 对我没有帮助!

Thanks Manav谢谢马纳夫

There doesn't seems to be an easy way to directly click the icon in your chrome browser.似乎没有一种简单的方法可以直接单击 chrome 浏览器中的图标。 However extensions normally have some pages you can access like an options or login page,and you can work from there.但是,扩展程序通常有一些您可以访问的页面,例如选项或登录页面,您可以从那里开始工作。

To figure out the url:要弄清楚 url:

  1. Navigate in your browser to 'chrome://extensions/'在浏览器中导航到“chrome://extensions/”
  2. Find the extensions your are working with (GeoEdge in your case)查找您正在使用的扩展程序(在您的情况下为 GeoEdge)
  3. Make sure the developer mode is activated in the top right, otherwise activate it in the chrome settings确保在右上角激活开发者模式,否则在 chrome 设置中激活它
  4. You should be able to see the ID of the extension now您现在应该可以看到扩展程序的 ID
  5. Navigate to desired page: 'chrome://extensions/EXTENSIONID/PAGE.html导航到所需页面:'chrome://extensions/EXTENSIONID/PAGE.html

Hope this helps.希望这可以帮助。

I was able to click on the icon(plugin/extension icon) using image matching technique of Sikuli.我能够使用 Sikuli 的图像匹配技术单击图标(插件/扩展图标)。 Thanks for the contribution though.不过感谢您的贡献。 Appreciated !赞赏!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法单击使用 selenium 和 Java 的复选框 - No way to click on a checkbox using selenium with Java 无法使用 Selenium(Java、Chrome WebDriver)单击按钮 - Unable to click button using Selenium (Java, Chrome WebDriver) Java,Selenium,Chrome - 无法单击按钮,即使它似乎能够找到它就好了 - Java, Selenium, Chrome - Unable to click button, even though it seems to be able to find it just fine 如何使用 selenium 记录已安装扩展的信息 - how to record information for installed extension using selenium Selenium(Java):click()不是单击按钮,它只是在选择。还有其他方法吗? - Selenium(Java) : click() is not clicking the button,it is just selecting.Any other way? 在网页上使用 Java 和 selenium 单击选项卡的最佳方法是什么? - What is the best way to click on a tab using Java and selenium on a webpage? 使用Selenium从Chrome网上应用店安装/添加Chrome扩展程序 - Install/Add chrome extension from Chrome Web Store using Selenium 在Java中使用Selenium单击按钮 - Click on button using Selenium in Java 使用 Selenium,是否有另一种更可靠的方式在 Headless Chrome 中的元素上使用单击命令? - Using Selenium, is there another, more reliable, way to use click command on an element in Headless Chrome? 如何使用Selenium和Java单击此“登录”链接? - How Do I Click On This “Sign In” Link Using Selenium & Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM