testing content of a webpage [closed] - testing

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am new to software testing and was wondering which is the correct way to test content of a web page. For ex. on a web page if there are 10 labels then should I test first header "Selenium Training and Video Tutorials" and then second details given below the header then further details in this way and create separate test step for testing different text? Or I can use div tag which will give me the complete content of the page at once and test everything in one step. I can do it in one step or divide into steps but I want to do it in a correct way. I am using selenium webdriver (java).

Adding to the arran answer, it is better to split the 10 labels into 10 assert statements so that you can easily know which one went wrong, and also use TestNG or Junit for assertions. Since you are new, there are methods in TestNG like
assertEquals(char actual, char expected);
So in your code, it might look like
header1="programatically get the value using selenium"
assertEquals("Selenium Training and Video Tutorials", header1)
Testng also gives you clear report too.

Writing separate tests for each label as described by you will be a great option for :
increasing understandability
tracking down any errors
fixing of the script (if required in future)

Related

Selenium + jmeter script execution [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am using jmeter OS Process to execute my selenium script. If I ran my python script individually, it will pass. The issue is when I put it in threads of 10 some of them failed. My question is does selenium need to "see" the screen to locate the element? From multiple threads, screens pop up very quickly, I think sometimes the first screen is not fully loaded and the next thread/Screen will pop up and cover the previous screen. I think that is why some of them failed.
Selenium does not need to "see" the screen to locate elements. That is the basic principle behind headless tests. A browser (headless, visible, or otherwise) creates a representation of the page in memory: a DOM. Selenium is then able to interact with that representation using the WebDriver.
In all likelihood you need to make generous use of Waits in order to have your tests run correctly.

What is method API Testing? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
My question maybe silly, but anyone can help me ? I have a question, i read in the internet: "API testing won't concentrate on the look and feel of an application.". It is the black box testing methods, so i need to use the white box testing methods or associate 2 method ?
That phrase means that when you test API you only deal with the data that is returned from the server (unlike UI testing when it also matters how the output is rendered). When you test API you can apply black-box testing techniques sine you know what the input should be and what output you expect.
White-box testing is the technique which is to be rather applied by developers who develope the API functionality.

What is the industry standard for automating test cases? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I am new to currently working project. They have 220 test cases to automate.
They are following the below procedure:
Assume that it has 5 features. Edit Mobile number, edit email address, edit alert, close alert, search transaction.
Login the app
Do all the above mentioned functionality
Logout
Maximum functionality at one test case. But cannot derive what exactly failed but taking less time.
But what we have followed earlier:
Login app
Edit Mobile number
Logout
Next test case:.
1. Login app
2. Edit e-mail
3. Logout. Etc. All are independent test cases but execution is time taking
Which is the industry standards? We are in the Same org but following two different approach. What is industry standard??
There is No Industry standard.
Just make sure no test case should be dependent on other test cases. Note that TestNG dependency differs. Just for scenario :
#Test
public void testEditNumber(){
//should have edit number functionality
}
#Test
public void testEmailEdit(){
// should be independent of **testEdiitNumber**
}
You have mentioned "cannot derive what exactly failed but taking less time".
If you put all the functionality in one method , it's quite obvious that It will be hard to debug and if we will talk about time, there's a hardly difference.
Suggestion :
Keep all the test method independent.
You can stick with what you were doing previously.

selenium scraping content from website into an array [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am interested in scraping content from a website and putting it into an array. Specifically, I am interested in scraping plaintext into an array by identifying the html element the plain text is under. I am using selenium with Java and I was hoping someone could shed some light on the best way to do this. I would be scanning in multiple plain text elements and putting them in sequential order, into an array. The plain text would be in html tables and I would need to take a specific section of the table that has the plain text I was interested in.
this is a rather broad question, but still I'm hoping I can help. I've used selenium with scrapy library (python) for scraping and it worked all very well. If your question is what's the best way to find the text in the HTML it is pretty much safe to say that the answer is XPath. It is a very simple language designed to extract multiple elements from html/xml. Just google for examples and I'm sure you'll get the hang of it. Selenium has quiate a few built-in funcionts for xpath, you'll find plenty of examples

My webpage has infinite scrolling, how should I test it? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am testing infinite scroll feature of my web application on a variety of pages. What aspects should I keep in mind?
What should be automated, using WebDriver for example.
The website is primarily targeting iOS/Android devices.
I would recommend NOT automating any UI feature, at least the visual part. I have found that testing functionality is fantastic with WebDriver, but that UI is harder, and generally not useful with automation.
For example, you could write a test that scrolls the page down, and verifies that new content is loaded. However, you would have no idea whether or not the layout of the content is any good, or even if its on the part of the page you are looking at, unless you thought of each possible scenario where the UI could be wrong, and you tested for each.
That being said, I would still use the UI to make sure it functions. I would scroll down the page, and click on a link to make sure that that link works. Rather than going to a URL, I would use the menu at the top.
In summation, I would test that the features function properly, but not test that the look good. That should be done in manual testing.
For UI testing (design) you can try Sikuli
Here is Sikuli Api you can integrate with WebDriver
Only issue is that Sikuli is not testing picture pixel by pixel... try it and you'll see PROS and CONS