How to open Chrome Browser Network tab and make browser offline using katalon - selenium-webdriver

I had a task to run the test case by making a chrome browser offline and run some steps and then I need to make it back online again and run the rest of the test case.
Can anyone guide me on how to make a chrome browser offline?(In the network tab of chrome developer tools, it has the option of making it offline.) I want to make that offline using katalon.
Thanks in advance.

It is possible to do that using Selenium 4. However, that is still in alpha.
Katalon currently supports only Selenium 3.

Related

Angularjs application fails to load UI properly on a chrome 76 launched by chromedriver 75 and above

Open Angularjs application on chrome with chromedriver through selenium. Try to click on the buttons it moves constantly up and down, which makes it impossible to click and selenium fails to click as the application is bouncing on the screen.
However, tried to replicate the same with a chrome browser manually launched it never happens.
Open the browser through chrome driver and launch the angularjs application manually UI keeps bouncing.
This means the issue happens only with a browser launched by chrome driver.
Tried with older chromedriver and chrome, this doesn't happen. Happens only with later releases of chromedriver i.e. 76 and above.
Angularjs version 1.7.2
Local chrome does work properly.
I used basic way of initiating the chrome with the below code, still no luck
var driver = new ChromeDriver();
Since the chrome browser behave differently only when launched through chromedriver, also since launching local chrome doesn't have an issue. I tried to launch the chrome as it would launch manually.
var options = new ChromeOptions() { AcceptInsecureCertificates = true };
options.AddArguments($"user-data-dir=/Users/{Environment.UserName}/AppData/Local/Google/Chrome/User Data");
var driver = new ChromeDriver(options);
The approach of using local profile user data does help to a certain extent when running on local machines, but when running on a remote machine it fails again and also you can't launch two browsers as the user data folder is used by one browser at a time, not feasible to have only one chrome browser and not multi threadable.
The latest chromedriver version 76 is w3c complaint so its better to use later versions than using older chromedriver.
Any suggestions or insights on why this happens only with chrome launched by chromedriver. will be well appreciated and also happens only with angular application.

Web Test framework for Mobile as well as Server browsers

Is there any framework available where I can write single set of test code for both Server browsers as well as Mobile browsers.
eg. test.py runs with Chrome on Android as well as Windows
I am planning to use browserstack for my testing until I figure out the infrastructure handling is possible with browserstack or not.
Please help me figure out a way for deciding over the infrastructure as well.
You can try TestCafe. It's an open source project.
TestCafe allows to run tests on desktop and mobile browsers without any additional installations and plugins.
Here you can see how easy to run tests on a mobile phone with TestCafe: https://twitter.com/DXTestCafe/status/804368394569052160.
Also it's easy to setup testing on mobile browsers in a cloud service (like BrowserStack or Saucelabs). For example you can find the "testcafe-browser-provider-saucelabs" plugin on GitHub to run tests on Saucelabs out-of-the box.
Selenium + Appium should be able to cover what you need to be done. To share code however, you'll need use a mobile browser (Chrome or Safari) or have an app that uses webviews that are the same as the browser version.
The Selenium bindings will handle driving the automation for the browsers. By itself, you could test the desktop browser with a normal size screen, as well as a mobile size, and test various browsers as well (Chrome, Firefox, etc).
Appium will allow you to open the browser (or app) on the mobile device or simulator, and if the web view is the same as the browser, the same locator strategies you used with the desktop browsers and Selenium will work with Appium as well (Appium extends the Selenium spec with browser capabilities).
If you code the framework using the Selenium Grid, you can then almost drop replace a remote managed grid setup (via Saucelabs or Browserstack) to run the browsers for you (otherwise you'd need to setup a local grid or run the tests with a local Selenium server set up)
All this is quite possible
framework available where I can write single set of test code for both Server browsers as well as Mobile browsers
We have build it in our company, since we have a vast diversity of different platforms and browsers to support.
We use combination of Selenium based frameworks on NodeJS
webdriverIO
cucumberJS
appium
... etc.
The main concept we try to follow is JAVA's WORA. To achieve all this you need a good understanding of DSLs, Application driver layer and design patterns (e.g. Strategy).
It is not that hard to put all this together, since Selenium supports pretty much every binding you need. Just pick the language you are most comfortable with and use it.

Debbugging angularjs app without ripple or browser because it uses cordovasqlite plugin

In my AngularJS/Ionic app I use the cordova-sqlite plugin and a local database to store data; I also use a web service to fill the database with data from a remote database. Well, sometimes I get a strange behaviour when I try to get data from the remote database.
My problem is that I can't debug the code in the way it is now.
If I try to use the ripple emulator it says that it can't work with the sqlite plugin. I googled around and found out that any plugin which uses native code won't work with ripple. I wanted to see the network transferring operations on ripple.
At the time Im writing this I'm usually debugging opening the system console and checking them out but this isn't a really good way to debug. I work on a mac with WebStorm.
Is there a way to debug my code on mac live on the device or simulator like in visual studio?
Have you tried GapDebug? It let's you debug your Cordova/Phonegap app on an Android or iOS device via Chrome Dev Tools or Safari Webkit Inspector and is almost magical. -> https://www.genuitec.com/products/gapdebug/

Browser Automation with Selenium: Fingerprints, recognizability and traceability?

I want to use selenium/webdriver to simulate a browser and scrape some website-content with it. Even if its not the fastest method, for me it has many advantages such as executing scripts etc.
For many websites it is forbidden to access them via an automated method, for example search engines like google or bing.
For one tool i need to scrape the estimated resultstat from google for several keywords. This will look like the following: simulate the browser that visits google.com and types in a keyword and scrapes the results, then after a little pause type in the next keyword, scrape the results and so on...
My question is: Is it possible for a website to recognize that I'm using selenium to simulate the browser instead of using the browser by hand? Especially the google case gives me some doubts. I know selenium is partly developed by google or at least by some guys working for google. So does leave selenium some fingerprints or isn't it possible to decide if I'm using the browser by myself or simulated by selenium, even for google?
No, nobody can actually see that you're using Selenium and not hand-operating the browser yourself with WebDriver. I'm not sure about the old Selenium RC, but it should be the same way. Here's how it works:
Selenium opens up a browser with a clean profile (or with a profile you selected)
Selenium is hooked up to the browser so it can steer it, control it. But the browser still does most of the work. Basically, Selenium replaces the user inputs to the browser, but not more.
You can easily verify this by reading the contents of the HTTP headers sent by your browser.
If you ever actually needed Selenium to be recognized by your server, you can use Browsermob-proxy and add a custom header to your requests.
All that said, there is one thing you must be aware of. While there's no way to detect Selenium directly, there can be some indirect clues picked up by the website you're visiting. Those usually include scanning for too many requests made in virtually no time - this might be an issue for you. Make sure your Selenium is behaving like a user.
EDIT 2016/04:
Apparanetly it is possible as https://stackoverflow.com/a/33403473/2930045 states that a company can do it. My guess - and it is nothing but a guess - is that they can run some JS that Selenium installs into the browser to operate.
Signs point to yes, sites are able to regonize that you are using Selenium.
Counter Example: www.stubhub.com detects and blocks my browser instance launched using Selenium while "normal" browsing done manually (not using the browser launched by the Selenium web driver) work with out issue.
See this stackoverflow question for additional details
Can a website detect when you are using selenium with chromedriver?

How to debug application in extjs in internet explorer and Google chrome browser

Can anybody tell How to debug application in extjs in internet explorer and google chrome Browser? is it possible using Breakpoints to debug to check the values?
Thanks
There is a good article provided by sencha. check the section for internet explorer, http://www.sencha.com/learn/debugging-ext-js-applications
I have been forced to use IE8 in an application which works in Chrome and Firefox but fails often in IE8.
Debugging ExtJS in IE8 is nearly impossible if the problem is in the framework. IE8's developer tools hangs loading ext-all-dev.js
Also you can't get stack trace as in Chrome.
I had to put alert() calls in suspect lines and the whole process is a nightmare.
If you can avoid IE, do it.
Else be VERY VERY patient...
You can use the Developer Tools for your browsers. I don't use IE but I use Chrome's Developer Tools all the time! And yes you can do breakpoints, check values, etc..

Resources