27

Main observations in unstable scripts are as follows: Selenium tests are usually unstable because of the unnecessary complexity created in your test framework Enabling parallel execution without keeping in mind that one test may affect the state of the system that in turn affect the other test running in parallel. Using deprecated modules Incorrect ...


6

This is a standard programming practice intended to reduce bugs in code. As a refresher, the final modifier prevents a primitive variable or object reference variable from being reassigned. Thus, primitives are immutable, and a reference can ever point to the object it initially pointed to. (This does not affect what methods you can call, even ones that ...


6

The more tests are integrated, the less stable they are. This is because they involve many more environmental factors. Basically, Selenium tests are not just integrated in terms of software components which compose your AUT, but also in terms of the particular version of the OS, particular browser version, particular graphical driver version, or "...


4

Yes, you are right, from Chrome capabilities documentations Use custom profile (also called user data directory) By default, ChromeDriver will create a new temporary profile for each session. Therefor you need to create and load a custom profile by user-data-dir. ChromeOptions options = new ChromeOptions(); options.addArguments("user-data-dir=/path/to/...


4

You should use contains: equals validates the attribute value is exactly equal to given value. As the attribute class value is "ng-untouched ng-pristine ng-invalid igx-input-group__input" you cannot say @class="ng-invalid" You should use contains instead driver.findElement(By.xpath("//div/input[(@formcontrolname='nic_no') and ...


4

First understand virtualization concepts: Your code runs on a system. In the past, we used to buy bare metals for each isolated code. Meaning if you want two servers you buy two servers. so if a code requires only 1G RAM, but the server you have is 32GB you are wasting remaining 31GB of hardware resource. To avoid this wastage the hardware virtualization ...


4

I cannot go directly to the last step The whole situation is caused by the fact you can't manipulate your application state. It may be an indication that the tools you choose do not match the testability characteristics of your application. Reconsidering either your tool or the way your application exposes state manipulation APIs may be important for you. ...


4

The purpose of using any test automation tool is to fail when the assertion fails. However, how you write your tests also matter. It's recommended when writing tests to use the FIRST principle. FIRST stands for: Fast Independent or Isolated Repeatable Self-validating Thorough or Timely In regards to the question: "I don't want to stop the test ...


3

It does something different. Java implementation shows: @Override public String getAttribute(String name) { return stringValueOf( execute(DriverCommand.GET_ELEMENT_ATTRIBUTE(id, name)) .getValue()); } and @Override public String getText() { Response response = execute(DriverCommand.GET_ELEMENT_TEXT(id)); return (String) response.getValue(); }...


3

You don't actually initialize the driver before you call it. Your SeleniumDriver.openPage() call happens without any of the initialization code for the driver being called. Your code: public static SeleniumDriver seleniumDriver; //initialize webdriver public static WebDriver driver; does not actually initialize the driver - it merely declares the variable. ...


3

Configuring the Unit Test Provider Tests are executed using a unit test provider. Add the corresponding NuGet package to your project to define your unit test provider: SpecRun.Runner SpecFlow.xUnit SpecFlow.MsTest SpecFlow.NUnit You can only have one unit test provider! Source: Executing SpecFlow Scenarios All these frameworks are supported , why would you ...


3

There are a number of uses of Docker from QA perspective in any qa company. Few of them are listed below: It runs faster in comparison to Jenkins or any other tool as the deployments are done in containers. Due to this, you can deploy the identical containers in different portions at the same time which makes it very quick. It’s quite easy to place ...


3

It checks all the boxes: Environments on demand Greater consistency across many users More reproducible and thus reliable environments Greater security options when implemented correctly Less 'it works on this machine but not that one' issues Less cost due to more virtualization and less physical machines to maintain Faster turnaround for changes when they ...


3

Are you sure you are using Page Object Model? logicPage.NavigateTo(); logicPage.ClickArticles(); logicPage.SearchArticleX(); logicPage.PressArticleX(); logicPage.AddArticleXToBasket(); logicPage.EditBasket(); You could have splited NavigateTo() , SearchArticle, EditBasket each one as separate pages Assuming that these pages are too small to be ...


3

Most programming languages support list of items and loops, some pseudo code: Create a list of websites/urls to visit (e.g. array) Start WebDriver Foreach url in list (e.g. a loop to go over each item in the list) Visit the page (e.g. driver.get(url)) Get the page source (e.g. driver.page_source) Check the page source contains something unique to the ...


3

You are creating the Browser object inside the login function. When it ends, it is eligible for garbage collection. You can pass a pointer to an object outside the function, so it will still have a reference when the function ends. driver = webdriver.Chrome(executable_path="C:\Program Files (x86)\chromedriver.exe",options=chrome_options); login(&...


3

You could try developing your own framework for a small demo site. Start small, add stuff when you need them. Take the existing framework as a model to look up to, but don't sweat if you don't understand everything yet. Be patient and try to understand one bit of it at a time.


2

The short answer is no. The longer answer is I'm not 100% sure but I'm fairly confident the answer is no. I've worked at Sauce Labs for a few years now, several of them in support. I've done a lot of hacking to try to make Safari and other Webdriven browsers play nice, and Safari has always been the most impenetrable. Since creating SafariDriver for Safari ...


2

Selenium will only interact with Elements a user would be able to interact with. The first question would be if your users have the same issue when trying to click the element you want to interact with, if they do handling the video should probably be part of your test flow. If it doesn't happen when you interact with the application manually try to reverse ...


2

I feel your pain. I live your pain: I am in the same situation, except I'm the only tester in the group and it's taken me years to get any stable, working test automation running. I'm not aware of any tooling that can be used to measure coverage in this kind of situation. When you're dealing with large legacy software where unit tests and integration tests ...


2

You already found the element that contains the company code, right? So, if that is a button, use the same findElement() method to click it: driver.findElement(By.tagName("tr")).click();


2

You may be running synchronous tasks against an asynchronous device - a web browser. Modern browsers, frameworks and pages frequently make calls, such as to API's, vendors, etc. that are done asynchronously. You tests may not account for this behavior and if not will consequently fail intermittently because of it, combined with other factors such as ...


2

Yes for Facebook However we don't know what happens in these companies development and testing operations There is no single answer here because different companies do different things. It is easy to determine if they have data-tests if by looking at their production source code. I did this for Google, Amazon, Netflix and Facebook. I found that only ...


2

Tl;DR: I think with the right tools and practises you could create a situation where automaticaly testing cross-browser is not really needed. It depends on the risks, for most situations it probably does not make sense anymore. I use anymore because a couple of years back browsers where not consistent in their implementation. During the browser wars they ...


2

I agree with the other commenters that the Page Object Model is a great way to structure test code for interacting with the page, however, for the tests themselves, I recommend writing tests for functionality instead of page-by-page. Tests aren't about validating pages, after all. All of your users and most of your staff don't care which page something is ...


2

I recommend writing the scripts for functionality. However I recommend staying to the full path (end to end) for the functionality being tested. However, this does not cover many of the cases or tests that are usually desired, therefore, in addition to selenium tests for full functionality I also try to have: 100% unit test coverage unit test coverage for ...


2

Another way to phrase this question is, "How do multiple developers use the same code base in their work?" Selenium automation is just using an open source library to set up testing. It's not any different to what your developers do in your teams codebase. The process and setup are the same. What does that look like? Ensure the Selenium project is ...


2

As per this article, For QA, Docker solves the classic problem of ensuring that you test the same application you ship. Because everything the application needs to run is packaged in the container, it can run predictably and consistently across the pipeline, and with different configurations -- no more pesky variables to track down. If a configuration issue ...


2

Is driver a chrome window session? No. A ChromeDriver represents a server than controls a Chrome browser running locally. The server will control the lifecycle of the browser, such as initiation, killing and controlling actions. For more details, see the docs Can I create driver = new ChromeDriver(); in every testng method or Cucumber scenario Yes, but it ...


2

What is chromedriver: chromedriver has code that can interact with browser. THis commands are exposed through an API ( This is what you see as chromedriver started on localhost:14563 ) . From the code we access this api endpoints to tell chrome driver to do something. Example, when you say elem.click() , selenium talks to the API and tells chromedriver to ...


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