7
votes
Accepted
Force a browser's visibility setting to true
It's possible to force this status with a Javascript injection via execute_script.
To simulate a visible document:
Object.defineProperty(document, 'visibilityState', {value: 'visible', writable: ...
6
votes
Enable Flash player on Chrome 62 while running selenium test
Correct Chrome blocks flash by default starting with Chrome 62
see https://support.google.com/chrome/a/answer/7084871?hl=en
This worked for me in Chrome 62, its a combination of answers already ...
4
votes
Disable physical mouse and keyboard in selenium
You should not be running tests on a machine used by user(s). Set up a dedicated computer or VM for testing and and use headless browser mode (more info here and here).
4
votes
Accepted
How to disable user from closing the browser until Test Execution is complete ? using Selenium Webdriver & Chrome
While Selenium can not prevent users from closing the browser, there are other ways you can achieve uninterrupted test execution.
Option 1: Use headless chrome
With chrome v60+ for windows, you can ...
4
votes
How can I bring Chrome browser to focus when running a Selenium test using ChromeDriver on Mac?
To bring the window to front, in C# I use this :
protected void BringWindowToFront()
{
var window = Driver.Manage ().Window;
var position = window.Position;
window.Minimize();
window....
3
votes
Selenium un-enable to find element
It seems the second page is opening in a new tab, please switch the tab before interacting with the page:
driver.findElement(By.xpath("/html/body/div[4]/div[2]/div[2]/div[2]/div[2]/div[2]/div[2]/div/...
2
votes
How to save a copy of web page DOM using selenium webdriver and JAVA/C#
You can try to dump page source and parse it, or dump only element source.
Page source to pageSource variable (Java):
String pageSource = driver.getPageSource();
Element source to elementSource ...
2
votes
Enable Flash player on Chrome 62 while running selenium test
A slightly tweaked solution to dimkin's has worked for me:
ChromeOptions options = new ChromeOptions();
// Disable extensions and hide infobars
options.addArguments("--disable-extensions");
options....
2
votes
Why do rspec-capybara chrome tests run headless fail on my mac and how to diagnose/fix it?
To debug, first try to take a screenshot in headless mode when you arrive at the button. Then take another screenshot before the test fails or after you click the button.
It really looks like you ...
2
votes
Accepted
Need help isolating a laptop camera related issue (camera does not start on Chrome, but would otherwise work fine, only happens to 1 tester)
My personal approach:
Find an identical laptop with the same type of camera and try this again, see it happens.
What I would look for:
From this laptop's specification sheet, what type of camera is ...
2
votes
Accepted
Python stops after opening webdriver
WebDriver path should be passed as an additional parameter to chromedriver.exe as below:
driver = webdriver.Chrome(executable_path=r"C:\TestFiles\chromedriver.exe")
driver.get("https://www.google.com/...
2
votes
How to handle response varying from developer tool to code debugging in chrome?
What you show is actually a response body. Headers are represented in "Headers" tab in Dev Tools like this:
Brief look up of what you provided shows that it's UTF-16 encoded string:
For example:
1 -...
2
votes
Programmatically determine chrome browser version regardless of OS
It turns out the reason chromedriver knows where chrome is installed is it looks for it in the default installation locations. See chromedriver requirements
I ended up using writing this script.
...
2
votes
Accepted
How to disable selenium from taking physical mouse on Chrome on user's machine on a different monitor screen?
Selenium does not "take mouse from you" it can however switch focus to a browser window if certain conditions happens (usually when new tab opens). To avoid this i suggest you run your tests in ...
2
votes
Headless mode buttons are hidden - I think the side drawer is closed?
But there is no way to know for sure since it is headless
Take screenshots
2
votes
Accepted
How to use proxy with authentification in Selenium with Chrome WebDriver?
You need to set Proxy-Authorization header to the request which are coming from your web browser. I would use browsermob-proxy for handling this.
Here you can find some example of how to use the proxy ...
2
votes
Accepted
How to start Chrome in automation mode from command line?
Before you're doing new ChromeDriver() in your code, add these lines:
System.setProperty("webdriver.chrome.logfile", "D:\\chromedriver.log");
System.setProperty("webdriver....
2
votes
Selenium : webdriver.Chorme() function problems
The error you are getting is
FileNotFoundError: [WinError 2] Impossibile trovare il file specificato
My guess is, this is because of this line,
web = webdriver.Chrome("C:\ Users\giova\Desktop\...
1
vote
Programmatically determine chrome browser version regardless of OS
You can obtain the browser version via WebDriver like this:
Capabilities cap = ((ChromeDriver) driver).getCapabilities();
System.out.println(cap.getVersion());
I have tested it on Windows ...
1
vote
ChromeDriver : driver failed to parse value of getElementRegion - understanding the error
I had the same problem, and solved it by deleting the line
SELENIUM_PROMISE_MANAGER: false
in my conf.js file on my protractor configuration.
1
vote
Accepted
Process for running test automation against Chrome Beta
"Before a new major version of Chrome goes to Beta, a matching version of ChromeDriver will be released."
It means you can ask for the specific beta target version (currently 75) from your dependency ...
1
vote
Can Chrome Dev Tools search an entire project for an html element?
Chrome dev tools (as well as the tools of other browsers) work with the context that your currently open page resides at. So the only thing you will be able to see is the objects in the DOM that your ...
1
vote
Accepted
Can you set an Active Directory username and password using Chrome capabilities?
Change URL with authentication to: http://user:[email protected] . This will work in part of situations and will authenticate you to needed service.
Credit goes to the following blog ...
1
vote
Need the same set of chrome extensions on browser page running under webdriver
General idea (as it was pointed by @AlexeyR. & @kirbycope) is to use Chrome Profile with already defined setting & plug-ins. Here I'm going to describe some underwater rocks of this solution.
...
1
vote
How to close application choice popup in Chrome?
This is not an alert. It looks like browser notification.
Try this Browser level notification
1
vote
Force a browser's visibility setting to true
The browser being the topmost app on the OS is actually (what I would call) a meta state that is outside of Selenium's scope of dealing with apps and browser settings.
So, if you really need the ...
1
vote
How can I place on-screen messages with Chrome running under Selenium control?
You can change the page title adding something like
((JavascriptExecutor)driver).executeScript("document.title = 'Test [" + testName + "]'");
This will not change page structure and won't introduce ...
1
vote
Accepted
Google extension Check My Links returns different test results for the same webpage
Some webpages display elements based on viewport size of the browser. I have used CheckMyLinks XPI with chromedriver in a test Automation suite in the past and it provided consistent results.
Please ...
1
vote
Using SuperTest/Protractor on unsecure HTTPS
As this is tagged with protractor, this is how you allow "unsecure HTTPS" via Protractor config:
In case of Firefox:
capabilities: {
browserName: 'firefox',
marionette: true,
...
1
vote
How can I bring Chrome browser to focus when running a Selenium test using ChromeDriver on Mac?
We have used Capybara with Chrome driver and we had the same issue. When we launch the url, Chrome window was sent to background. To overcome this issue, we have used the following code and it works ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
chrome × 77selenium-webdriver × 57
chromedriver × 19
automated-testing × 12
java × 11
python × 10
browser-automation × 6
ruby × 5
headless × 5
c# × 4
manual-testing × 3
selenium2 × 3
javascript × 3
web × 3
protractor × 2
tools × 2
cucumber × 2
android × 2
web-application × 2
jenkins × 2
mobile × 2
cross-browser-testing × 2
windows × 2
aws × 2
xpath × 1