27

driver.close() and driver.quit() are two different methods for closing the browser session in Selenium WebDriver. driver.close() - It closes the the browser window on which the focus is set. driver.quit() – It basically calls driver.dispose method which in turn closes all the browser windows and ends the WebDriver session gracefully. You should use ...


9

I have worked with Web Driver in both java and C# and I use In Java : WebDriver driver; driver.quit(); In C# : IWebDriver Driver; Driver.Quit();


9

This is how I would debug a Selenium session to find out what is happening: Step-by-step debugging: Most IDE's allow you todo step-by-step debugging, you could set a break point just before the point you want to investigate. This will pause the execution of the test and lets you examine the browser with its own tools. You can step thru each line of code one ...


8

This Stack Overflow thread suggests that there are differences and the modes are not totally accurate. Depends on your definition of risk and how accurate the results have to be for you and your stakeholders


8

You can try setting implicit wait time. (Documentation) // 5 seconds implicit wait (C# code) IWebDriver driver = new FirefoxDriver(); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));


8

Test code cycles much faster than production code, and it's not uncommon for there to be major changes to how an application works during the early stages of its development. Clearing the cache ensures (mostly - server-side caching can cause problems) that the tester is looking at the code they think they're looking at. I typically don't clear cache ...


6

Headless Chrome is not stable yet in comparison to "full" Chrome. In my opinion there will always be problems with headless vs phantomjs (and others) vs full versions. And so there will always be place for phantomjs (and others) in the world of automated testing. Consider your choice wisely. Few possible limitations of Headless Chrome: Headless mode is ...


5

A simple JavaScript error might be a reason of a huge bug. I am always having “Show JavaScript errors” turned on my browser. Let’s consider the following situation: During saving a Web Form, some JavaScript exception had occurred while populating data from the UI input fields into internal JavaScript object, for instance, JSON object. In this case, some ...


5

I know of no "Industry Standard". And whenever I hear this sort of question, I always think "What industry do you mean?" The testing industry? The software industry? The website industry? The industry that offers an application identical to yours? For your particular website, what kind of zooming do your users do? That's where you should be concentrating ...


5

The JSON Wire Protocol is on it's way to becoming accepted as a W3C standard. This means that moving forward, the vendors behind browsers will have much more incentive to implement and maintain implementations for their browsers. Some vendors such as Mozilla and Microsoft have already taken over maintenance of the drivers used by Firefox and Edge. I heard ...


5

This is an incorrect assumption. A webpage loads as follows in generic terms: Server content is received by the browser. Rendering begins starting with objects and then styles from a layout as in all at once and if you slowed it down you would see a pixelated progression as it took shape starting with the content areas and then the objects and then the ...


4

I believe most computer users in the general population do not install any plugins at all -- especially if you consider mobile users. Personally, I would not do any plugin compatibility testing without explicit evidence of a conflict. By the way, this recommends a way to prevent the Skype plugin from breaking your page layout.


4

The short answer is that each browser implements the industry standards based on the implementation team's understanding of those standards. There are several different base engines that are used by different browsers, including but not limited to WebKit, Gecko, Trident, and Blink. That accounts for the majority of differences in behavior between different ...


3

What you're looking for is called a javascript profiler. Most modern browsers include some kind of a profiler with their developer toolkits. Here are some links Chrome JS Profiler Firefox JS Profiler A good code profiler (JS or not) will tell you who started what function call (stack trace or call tree), how long the particular function was running and ...


3

I found this site that offers a sample of user agents in csv format: http://user-agent-string.info/download Actual download link: http://user-agent-string.info/rpc/get_data.php?uaslist=csv The format is: "Type","Name","useragentstring"


3

I searched Google for "User-Agent strings" and found this and this and this. If you work for a company with a website, you might try asking them for a list.


3

Yes, Pages should be tested at zoom level. Because its come under the quality of project. Website quality should not be compromise at any level. User can think in any way. So if on zooming Web pages alignment disturb then its come under bad quality site. We should focus on every point for good quality.


3

Sadly, years of playing with emulators of one form or another has taught me a very simple lesson: There is no substitute for testing your software on it's target No matter how good a simulator or emulator you are running, there will be enough situations that the sim/em-ulator doesn't cover 100% accurately that you are leaving potential problems I've also ...


3

In Python, using selenium webdriver for Chrome, I needed to call stop_client() before close(): from selenium import webdriver in setUp(): options = webdriver.chrome.options.Options() options.add_argument("--disable-extensions") # optional and off-topic, but it conveniently prevents the popup 'Disable developer mode extensions' self.driver = webdriver....


3

I edit the firefox profile to disable native events. Also maximize window and it works fine FirefoxProfile p = new FirefoxProfile(); p.setEnableNativeEvents(false); WebDriver driver = new FirefoxDriver(p); driver.get("url"); driver.manage().window().maximize();


3

Managing multiple browser setups on a single machine sounds like a nightmare. Also I wonder how many browsers you really need to support, have a look at Browser market share per version. I think services like: https://www.browserstack.com/ https://saucelabs.com/features#features-manual-testing http://testingbot.com/ Are better suited for your browser ...


3

multiCapabilities: [ {'browserName': 'internet explorer'}, {'browserName': 'chrome'} ], maxSessions: 1,


3

Thanks for your attention to this post. I finally found the problem when one of my colleague suggested to use VNC to see what's actually going on the linux machine. For debugging, we need to install "x11vnc" package on the system where tests is being run and then connect to the system using VNC Viewer on a Remote Host. On target system, run "x11vnc -...


3

I think you can use pure JS to achieve this. The cross-browser way to do it in pure JavaScript is simply to test document.readyState: if (document.readyState=='complete'){ //you can do something here } You can select from either an loading, interactive or complete states. This returns a loading state while the document is loading. If you only want ...


3

I am using headless chrome in version 65 in protractor test execution and I find it pretty stable for a suite of 500+ tests and even for the failed tests screenshots captured are of decent quality and useful.


3

I think the general answer is "be reasonable". Just because you're doing blackbox testing doesn't mean you should do extra useless testing--in this type of situation, you're likely better off looking at how the code is implemented and deciding on the scope of testing accordingly. I've seen too many blackbox tests that were long and painful to execute but ...


3

Try to use this (children()) instead of getAllElements(). Because when you use the latter one, you get the node itself alongside with its children. Hence you will always be cycling between two methods.


3

Well, after much trial and error with TestCafe, Nightmare Browser, Nightwatch and Cypress, all of which I couldn't get past the above blockers, I've had a result with old school Selenium!! https://applitools.com/blog/automating-electron-applications-using-selenium I referred to the steps in this blog to get Selenium to work with a custom binary.


2

Have you tried having a look at Selenium or what is now called Webdriver (Selenium2)? You can use the Selenium IDE to record your tests on Firefox. However after the tests have been written they can be converted to other languages such as C#. Java. Once that is done its quite easy to get the same test to run on Internet Explorer, Chrome, Mobile browsers, ...


2

There is an alternative way to get a specific browser version - use browserstack service. It can fire up almost any browser on almost any operating system. You can also run your selenium tests on browserstack, see Selenium Cloud Testing.


Only top voted, non community-wiki answers of a minimum length are eligible