Error while spying elements on Chrome browser in blue prism - blueprism

After spying element in web application in chrome browser and highlighting the element it throws an error like:
Error - Highlighting results - No matching Web elements found
Using BP version 6

The problem is that there are multimple chrome processes running in the background on your machine.
Solution:
1. Open Task Manager and kill all instances of Chrome process.
2. Launch new Chrome window from BluePrism
3. You should be able to spy element of the displayed web page now.

You should download the Blue Prism Browser extension for Google Chrome
and try spying the elements again.

Related

Is there a way to access chrome extension background pages on Cypress?

I'm interested in seeing the network tab in an extension's background page while running tests using Cypress.
When I go to chrome://extensions and click background page within the Cypress browser nothing pops up. I've also tried navigating directly to chrome-extension://(extension-id)/_generated_background_page.html but this stops the extension from working entirely.

How To Hide Chrome Web Driver Icon (Python-Selenium)

UPDATED WITH REASONING
Goal: Run chrome web driver in background without showing an app icon in the dock or application bar. FYI: I can already run chrome headless, but I have not been able to hide or not show the chrome icon in my app bar.
Reason: I am building an application that accesses various websites in parallel and I would not like the chrome app icons to display for the synchronous tasks that are taking place. I want to run these tasks in the background.
Current Code with chrome options that will display headless chrome
chrome_options = Options()
chrome_options.add_argument('headless')
chrome_options.add_argument('window-size=1200x600')
driver = webdriver.Chrome(executable_path=executable_text, chrome_options=chrome_options)
Research
list of chrome options: https://peter.sh/experiments/chromium-command-line-switches/
one of many posts explaining how to do headless chrome: Selenium - chrome Driver fail to start in background (without a start-up window)
How can I hide the chromedriver app icons from displaying? Is there a chrome option I can set in addition to setting the 'headless' chrome option? Is this more of an OS setting that needs to be made to run chromedriver in the background? I am successfully able to run multiple chromedrivers in headless mode but it would be nice to NOT show the chrome icons in the dock or application tray similar to how phantomjs does not launch an app icon.
^In the image above those are the chromedrivers that run in headless mode displaying in my dock and ideally for my program I would not even want to display those icons since it is all background processing anyways.
Update (this worked for me to hide the chromedriver icons at least on my Mac):
I was not able to find a Chrome Option to accomplish hiding the chromedriver icons that appear in the dock. However, I was able to edit the Info.plist file for Chrome as part of my program to do the trick (of hiding chromedriver icons) using the LSBackgroundOnly key.
In the Info.plist for Chrome, programmatically, I entered:
<key>LSBackgroundOnly</key>
<string>1</string>
On my Mac using python3 code I used os.system to execute a terminal command using defaults to enter the LSBackgroundOnly key when the program is executing and then at the end of program execution I delete the LSBackgroundOnly key from the Info.plist.
like this:
1)
defaults write /Applications/Google\ Chrome.app/Contents/Info.plist LSBackgroundOnly -string '1'
2)
defaults delete /Applications/Google\ Chrome.app/Contents/Info.plist LSBackgroundOnly
AS INFO: This is tricky because your normal chrome app may start up in background mode if you don't add/delete LSBackgroundOnly properly during program execution. In my experience, worst case scenario you may have to manually remove LSBackgroundOnly from the Info.plist file then restart your computer to get Chrome out of background mode.
I remove the LSBackgroundOnly key from the Info.plist file in my program after program execution because the key only needs to be in the file when the chromedrivers are launched. After that I want to be able to use regular Chrome app without issues of it opening in background mode. But, if you understand your program execution and handle your exceptions, this will definitely work to hide the icons correctly and there will be nothing different in using your regular Chrome app.
Happy hacking.
This is not possible using Selenium. I don't really understand why you want to do this. Is there a real purpose, or it's just you don't want it to show? Even if the Chrome app shows on the dock, in headless mode, it works pretty good.
However, if you want your icon to not appear in the dock when opened, then you need to disable it by modifying the Info.plist file for that application.
In your Info.plist for Chrome, add this
<key>LSUIElement</key>
<true/>
This will prevent your app icon from appearing in dock, when working. I found this out a long time ago and this is the post where I saw it.
PS - I have not tested it for Chrome app. Please test at your own peril.

chrome extension occurs multiple times in Task Manager

Sometimes my extension stops working (clicking the browser action doesn't do anything, it stops doing its background activites). I'm debugging that problem.
When it stops working, if I click 'background.html' to open the background page, I get a blank white window instead of the background page (none of the panels open). Reloading the extension from 'chrome://extensions' doesn't allow me to get the background page either. I have to completely quit the browser and restart. If I keep the background page open and then the extension stops working, the JS console doesn't work. I can't use the 'Sources' tab to find out what stack frames are executing etc.
I also noticed that the extension occurs multiple times (multiple adjacent rows) in Google Chrome's own task manager. But I'm unable to select them individually. Clicking one row selects them all.
Anybody seen this before?
Could this occur if my extension code gets into an endless loop? I don't see high CPU usage either at the OS level or in Google Chrome's task manager. Same behavior under both Mac and Linux.
FWIW the extension is relatively complex: it uses web workers, 10s of uploads and downloads in the background page.

Having difficulty white listing a chrome app for Chromecast

I have successfully whitelisted my Chromecast device, however while trying to whitelist a local Chrome App as a sender I have run into difficulty with the instructions saying
Be sure you are running Chrome version 28 or later.
If you haven't restarted Chrome in a while you may be running an older version; restarting will update Chrome automatically.
In the Chrome omnibox, enter chrome://extensions, and check the Developer mode checkbox to enable developer mode.
Install the Chrome extension for Google Cast.
5. On the Cast icon in Chrome's upper right corner, click four (4) times.
6. In the Cast extension, scroll to the Developer options.
7. In the Cast SDK additional domains field, click Add and enter the domain of your application, for example, "www.mydomain.com."
Code your application's HTML tag as follows:
When I click on the chromecast icon 4 times I get no developer menu, making it impossible for me to whitelist my chrome app. Am I doing something wrong or going about it the wrong way?
I am using Chrome 28.0.1500.71 on Mac OS X 10.8
Open up Chromecast options from the extension, and then click the cast icon in the top left corner repeatedly (4+ times), and developer options should show up at the bottom.
Documentation is incorrect, found this out through trial and error.
The documentation is currently incorrect. To view the developer SDK menu, click the chrome cast extension icon in chrome, click options, then click the google cast icon in the upper left corner a bunch of time. It isn't 4 times, but if you click 4 times, wait and click twice more, I've been able to get it to come up.
This will give the option to input a domain which will cause the google cast extension to inject the API into pages on that domain.
Make sure not to include http or the path. In my testing it seems to wildcard match so example.com will match cast.example.com and castqa.example.com.
Right click the chromecast icon and goto options. Then click the icon at the top of the page 4 times.
I personally had to click options then right click on the option page and inspect element. In the Div with the class options-selections class on it change the 5th section element to display:block;
Or.. Goto the console and put this in:
first = document.getElementsByClassName('options-sections')[0]
first.getElementsByTagName('section')[4].style.display = 'block';
If you look around there are other sections hidden in here. Might be other goodies of use.

Detecting Chrome browser exit?

I tried everything but nothing seems to work for me. I tried to detect the closing of the browsing by detecting window closing like the code below but that does not work for me. What am I doing wrong and is there another solution to detect Chrome closing?
chrome.windows.onRemoved.addListener(function(windowId){
alert("Browser exit!");
});
Your general problem is that quitting the browser means that browser can no longer run your script to check if it has quit yet -- it's like trying to ask a person if they've died: the answer (if you get one) is only ever going to be "no".
One solution you might try is a long-running background page with the background permission:
Makes Chrome start up early and and shut down late, so that apps and extensions can have a longer life.
When any installed hosted app, packaged app, or extension has "background" permission, Chrome runs (invisibly) as soon as the user logs into their computer—before the user launches Chrome. The "background" permission also makes Chrome continue running (even after its last window is closed) until the user explicitly quits Chrome.
This permission allows the Chrome to keep running your extension even after all browser windows have closed. Normally, Chrome can only do things when it has windows open, so we run into the problem of Chrome being unable to detect when all windows have closed (as explained above). With the background permission, Chrome retains the ability to run extension code even when all windows have closed.
i'm just looking to get control when my extension exits not the entire browser; my extension uses a text box exclusively, so i set its onblur property to a function and put my exit code there; probably not what you're looking for, but it works for me!
the chrome developer website recommends not using background pages due to "memory and other resources they consume";
i agree a more consistent way to get control on extension exit would be useful; it is an html page that otherwise seems integrated with the dom;
chrome does not provide any API to detect chrome browser is going close. However, we can detect chrome browser opening event inside background page when using chrome extension.
background.js
chrome.runtime.onStartup.addListener(function () {
console.log("extension started: " + Date.now());
});
this event will fire when chrome browser will start. next you can use any trick to identify the chrome browser was exit.

Resources