I've recently started to use Selenium IDE for the automatic testing of a website I'm working on. I've created all the test cases with the LIVE base URL. Then I created a test suite but now I would like to apply all the tests to the staging environment.
I tried two things:
Update the base URL from the test suite. I opened the test suite, when to each case and changed the base URL in the field at the top. Saved and closed.
Update the base URL in each test case, individually. Yep, I opened each test case (amd there are like 60 or something) and changed the base URL both in the top field and in the source (in the link rel tag). Saved and closed.
My problem is that none of these changes have been saved, I've applied them 3 days ago and now I've opened the test suite or the test cases, they still have the LIVE base URL.
I'd be very grateful if someone could help me figure out what I did wrong or if I'm obliged to start again from zero.
Best regards
Samkoukai
Try opening each test case in an HTML editor (like Notepad++, or even just Windows Notepad) and edit this link to the base URL you want:
<link rel="selenium.base" href="http://www.yourwebsite.com/" />
Related
I need your help, I have recorded a login script in blaze meter and importing it into JMeter what I noticed that browsing URL is repeating like site.com/0, site.com/1,site.com/2 and so on. Please suggest what to do to fix it asap help required. thanks.
I am trying to record a login script in blaze meter when I imported the script in JMeter I found that the browsing URL is repeating. like example.com/0, example.com/1,and so on. please help me.
We cannot "help" without knowing what are your expectations.
When it comes to performance testing of web applications you need to ensure that JMeter is properly configured to behave exactly like a real browser.
It means that JMeter should send the same requests and in the same manner as the real browser does.
In case if the network footprint generated by JMeter matches the one which the real browser produces - you don't need any "help" there. If it doesn't - we need to see:
the dump of requests from "Network" tab of your browser's developer tools
how did you configure the BlazeMeter Chrome Extension, i.e. choosing "Only top level requests" might "help" you
Normally these numeric postfixes are used as the naming convention for the Transaction Controller to all nested redirects, embedded resources and so on would be considered an integral part of the parent "transaction"
I add a new category in the admin panel and want to ensure that the category is available in the dropdown on the user's part of the website. Recorded test in the Selenium IDE works fine. But the thing is, the task that I execute is of course not a pure frontend thing - the category is saved in the database and is loaded from it to show it to the user. So if something goes wrong on the database-side, the test will fail.
My question is: is it bad practice to do such tests that depend on backend-behavior ? Should I go for Selenium Webdriver ?
If you use Selenium Webdriver, your test will not change in a main thing. It still will check database side. Selenium Webdriver is just anouther tool for testing that is more flexible and allows to make more complex test then in Selenium IDE.
I don't think that it is bad practice, because it is just one of the tests that chould be executed to enshure you that this part of your project works correctly. In this case I would check back-end part(get all categories from DB or admin's panel and check that there is no extra or missing ones) and than check user's panel(all categories are the same as set in DB and admin's panel).
we have a page with several links and our automation clicks on a link and checks if it does not give a 404 and if the link has our company name. Is this a good way to test links in a page or is there is a better way to test links as part of e2e?
Yes, we need to click all the links one by one and verify the links should not broken. This is how we do in manual testing right? It should still implies the same in test automation.
For the verification part, you may also include some more testing on the page that you just clicked:
Validate the locator or specific web element is present there (can check it's xpath).
Validate some text should contain on that page as expected.
We can also check how many seconds it takes to completely load the page. So, you can find out if there is any web page/link is having bad response time. Every test automation framework has different way to do this.
How do I know what should be a test case and what a test suite in Selenium?
Is there any general rule for it? I've read the seleniumhq site any several others, but
they only have some basic examples while I want to test a whole website.
My questions are for example:
Say I'm testing some multi-step web form. Should I make it one test suite and each
step (in web form) would be a single test case or all steps should be one test case?
Say I've built a web forum and I want to test several features in it. Do I make one
test suite and each test case tests each feature (or several cases per each feature) OR
I'll have many test suites and each suite tests one feature with a few test cases.
What to do if I have a form which contains 5 checkboxes - each of them can be obviously clicked
or not. This may have some consequences when I submit the form. So - theoretically there are 2^5=32
possible execution flows. Should I test all 32? Or maybe should I just test each checkbox separately
to simplify things. When can/should I simplify, when not? (assuming that checkboxes MAY be
somehow related).
Should each feature have test cases which test both positive and negative results?
For example should I just focus on correct workflows - i.e. submit valid form and see if the
website did what I asked for (worked) OR also submit empty form and check if error message
appeared.
Can you answer these giving some practical examples (if needed)? - maybe using some (StackOverflow?)
site as example site.
Answer to 1 and 2:
I think this is more an issue about test design than selenium. Consider Selenium as a tool which controls the browser/website like a user would do. It simulates a user clicking through the page. To know what a test case is and what a test suite is you should think of the functionalities of your web application you want to test. Let's say you have web shop than one test case could test the following use case:
user puts articles in cart
user enters his data (name etc)
user gets a summary of his order
user confirms the order
It depends on your application which workflows or functionality you want to test.
I would consider a test suite for a whole project so one suite for one web application. And this application has a lot of test cases. Every test case is a use case.
When building a test suite, consider some design patterns like ui-mapping, page object design and consider the advantages of a test management system (like TestNG in Java).
here are some links to that:
http://www.shino.de/2011/07/26/on-the-pageobject-pattern/
http://www.theautomatedtester.co.uk/tutorials/selenium/page-object-pattern.htm
http://www.cheezyworld.com/2010/11/09/ui-tests-not-brittle/
http://hedleyproctor.com/2011/07/automating-selenium-testing-with-testng-ant-and-cruisecontrol/
Answer to 3 and 4:
It is similar to 1 and 2. It is always a question WHAT you want to test. Or a question what your project leader wants you to test (or customer). Every functionality which is important and should work should be tested.
I am writing a set of tests to perform equivalency of web pages. The only differences (declaratively in the test) are the URLs. I'd like to do this by somehow performing multiple store text commands prior to a test so that I can use the stored properties later within the testpage. Is there a clean way to do this?
old properties file
login.page=Login.jsp
new properties file
login.page=/new/Login
And the tests looks like:
.. do some storetexts ..
open | /mypagehome/${login.page}
Sorry to clarify: I have 2 selenium tests for each page. These two tests are exactly the same with the exception of the url. One test the old site , one test the new one. Id like to only have one test and be able to point it to different instances of the site, i cant just use the 'base url' because the urls for both sites are significantly different. How do i get round this problem?
Ok, I think I understand now! :-)
Selenium lets you open absolute URLs instead of just URLs that are relative to the base URL, so you could use something like this:
open | http://somedomain/mypage/${loginpage}