Another approach (or part of one).
Before proceeding ask for a sign-off on a document that clearly states the security risk this presents to the organization and its customers and that they acknowledge that risk. This might get more attention, though it is obviously a little aggressive (or may be perceived to be that way). Adjust approach as needed for ...
Given that the customer insists, I'd recommend using a virtual environment with IE5 installed, and then search for automation solutions that can work in that environment. This will be a challenge: you will need something that can operate on the elderly operating system (I think XP can run IE5, but I'm not sure about anything newer) and preferably something ...
1. Trust your code and doubt SUT (Software under test):
If everything was working fine and the test starts to fail suddenly. Instead of debugging your code for issues, start with checking the actual product. Do some visual inspection and see whether the development team has modified the element or the element is no longer being displayed.
2. Trust your ...
my colleagues suggest me to learn and create a fully functional -
generic framework which any team can use?
I suggest you don't. Your coworkers suggest you to start over-engineering. It is fine to experiment.
Automate a test, automate another one. Maybe a reusable abstraction emerges. Maybe this becomes a reusable framework. Practise the YAGNI (You aren'...
You can use a CSS Selector looking for a substring at the onclick attribute:
This will look for the client regardless of the position.
If you want by position:
Well, first I would ask these questions:
Do you really need to write Selenium test for all of these 500 pages?
Do your developers write enough and good Unit tests?
I assume it is a Single Page Application and for sure there are so many common components between these 500 pages i.e they are not 500 unique pages with completely different behaviours and ...
Page Object and Selenium's PageFactory are distinct things in nature, usually the latter complement the former.
Page Object is a design pattern aimed at solving the problem of separating the application interface from the HTML interface.
Why do we separate these interfaces? Because web pages elements and functions, as saw by the user, differ from the HTML ...
How do users verify the data is saved? I would make the test take the same path.
In your case placing an order might result into an item in the checkout shopping-basket. Find elements in the shopping basket and count them, get their text and validate that with an assert library (JUnit or TestNG).
WebDriver driver = new ChromeDriver();
Because in your first example all your span elements reside on the same level so that they all have different positions. However in your second example each span resides within its own container (<b>) where each of them has the position=1, hence all the elements are returned.
To return first span in your second example you can use the xpath like this:
Multi-device/browser testing strategy
Above all else:
Know your user population and the devices they use and the way they use them
Determine if your focus is manual or automation testing as they have different requirements
Find out what browsers, devices & versions are used by your users (server logs, new relic, etc.)
Ask the business what percent of ...
Creating test data via GUI will have the following impact:
test execution time will grow,
test will become 'flaky', results will not be trusted,
test will be prone to errors due to html changes,
if you use CI you will become dependent on browser,
or will have to write browser independent code,
I suggest creating the data straight in the database (if ...
I think in Python you can check for None or "" on Empty string
Also check this question for other options:
I think it is a stupid question to ask in an interview, because it asks a very specific detail of how to use WebDriver that I have not really thought about in the 10 years I am using Selenium, but this might a great answer:
I don't know, but I could try and see what happens. Why do you ask? Did you have problems with this in the past?
I have just tried ...
Hi size() returns integer and you are comparing with string
You can use the size() method of java. util. ArrayList to find the
length or size of ArrayList in Java. The size() method returns an
integer equal to a number of elements present in the array list.
So the ...
PDHide's answer is good in general, but since you specifically ask about verifying selectors, I would like to add that you can test them in a browser console. For CSS selectors, you can test with
For XPath, you can test with
Each of these will return the first matching ...
You can either:
Look for all element that match certain search criteria:
# No element found here
Catch an exception when searching for a single instance:
# No element found here
Some options in my order of preference:
Probably you do not want to test the TwoFactorAuth, but you want to test the application behind it. Consider building a backdoor which is only enabled in the test environment, so that you can bypass the TFA.
Generate the OTP from code with OTP.Net: https://dev.to/j_sakamoto/selenium-testing---how-to-sign-in-to-two-...
I think if you stick to simple PageObjects as described by Martin Fowler it is fine. It should be a simple abstraction to keep your test-code DRY, reusable and increase readability by using page-methods that describe behaviour of the page/view.
The linked article is mainly about issues with Page Factories and thinking PageObjects have to return another Page ...
When I think how to design a test framework I always ask myself if the code I am writing would be easy to understand by someone else in 6 months. That is why I would suggest to keep it as simple as possible.
Since we are talking about a small amount of test cases that will deal with the timeout, you can implement timeout specifc functions inside ...
THINK BIG; We are going to automate everything! I am so excited!
act small; Automate a single user flow. (Not login, but a real end-to-end behaviour, login might be part of this.)
Fail fast; Struggle...
Learn rapidly; Retrospect, inspect and adapt, decide on the next experiment and goto act small.
I love simple PageObjects as pattern. Not as a "framework". ...
Just be yourself. They asked you to the final round, so they see potential in you.
Swamping yourself with more topics and information might overwhelm you more than it benefits.
The interviewers will look at you someone with 2 years of experience, not a guru/expert/god/know-it-all.
Be honest, and saying I don't know is an good option to most questions. I ...
Chrome provides an inbuilt function for this:
Dev Console (F12)
Switch to the Sources tab
Do action in browser to get to the state you want to inspect
Chrome will pause the browser and the Elements tab will not update until you go back to Sources and Press F8 again. While it is paused you can switch back to the Elements tab and use the normal ...
Actually, you can.
ChromeDriver x = new ChromeDriver();
is a perfect valid Java statement.
The point of using the interface WebDriver on the fact that all the API (methods) that you will be using are defined on the interface:
The classes ChromeDriver and Firefoxdriver implement these methods for the specificity of these browser. However, for your usage ...
You can get the selected value from dropdown using getFirstSelectedOption() and getText() methods.
System.out.println("Selected country: " + drpcountry.getFirstSelectedOption().getText());
For reference: http://seleniumtwo-by-arun.blogspot.com/2013/07/144-using-getfirstselectedoption-with.html
Now for the longer answer.
If you have full control over your test database, you can have your tests configured in a way that allows them to always start from the same known point. One way to do this is to restore your test database at the start of each test run. Another is to use containers.
If restoring the test database isn't possible, you ...
This is going to be blunt. I don't know a not-blunt way to say this.
First, learn to code. Working with Selenium, no matter what your toolkit happens to be, is writing code. If you don't understand the code or the principles behind the code, you will be constantly frustrated, and worse, you will irritate your peers with what will seem to experienced coders ...
This question is about WebDriver W3C specification. As per the specification any implementation has to follow:
If url is not an absolute URL or is not an absolute URL with fragment or not a local scheme, return error with error code invalid argument.