exclude class in testng.xml in selenium webdriver - web

Hi i am new to testng in selenium web driver..
in my testng.xml 19 classes are there i want to exclude 7 classes or sometime 14classes, is there any proper way to do it?please give some example if possible.
thanks

You are looking for test selection mechanism, based on certain criteria - let it be package or group. Yes, this can be done with TestNG. Here you have a number of detailed examples:
http://automatictester.co.uk/2014/05/10/selecting-tests-to-be-run-via-testng-xml-file/

Related

JMETER - WebDriver Sampler - Groovy - Dynamic Name (3 Level)

Thank you for your prompt responses. I have tried the below codes but looks like not picking up the values because there's 3 level of variables. Can you please advise? Thanks.
1st level: xpath=(//input[#type='text'])[7]
2nd level
it doesn't work: //li[contains(#id, 'cascader-menu')]/span
or
it doesn't work: //li[contains(#id,'cascader-menu')]/span1
I don't think anyone is capable of coming up with a proper unique locator by looking at the screenshot without having access to full DOM or application
From what I can see so far you need the following element:
//input[#placeholder='Select...']
However it may or may not work depending on:
whether there is another input element matching this query, if there are more than one - the action goes to the first match
it is visible
it can be interacted with (i.e. not covered by a modal window or not disabled)
phase of the moon
You can test your expressions using your browser developer tools and given you will get the match - Selenium will also be able to find the element and hopefully work with it.
If you going to continue repeatedly ignoring my suggestions of getting familiarized with DOM and XPath concepts I can only suggest recording the scenario using Selenium IDE or JMeter Chrome Extension and hope that it could be replayed without modifications.

cucumber scenario with more than one tags

Is it possible to add more than one tag to a cucumber scenario?
For example, I have a test which I need to include in smoke test as well as regression tests. When I add 2 tags to the scenario, it is getting skipped
Yes, you can add multiple tags. For more information, see the Cucumber documentation

How to rename a Testcase or Teststep using Groovy in SoapUi

I am re factoring large sets of tests in SoapUi.
Is there a way to automate creation and renaming of test cases/test steps through Groovy?
Thanks.
Possibly not what you're looking for but I've had some success manually editing the test suite xml using find and replace in a text editor. You need to be careful and make sure to back up a copy.
You can run Groovy code within SoapUI using SoapUI Groovy Console plugin. This way, you can change any property you want programmatically (within API constraints of course).
As for technical details on how to solve your actual problem, I can only refer you to this blog post and SoapUI's javadoc. Based on the blog post, you need to figure out what's given to you, and based on the API, you need to figure out how to achieve what you need.
In my case, I started with my project being bound as a project variable, and moved on from there.
There is really not so much information in the question about what you really need to achieve, but given the little you provided, one way to go would be to directly modify the soapUI project XML file. I have done this with some success in the past. The last I used soapUI, it UI did not come with massive refactoring functionality.

What is the use of TestNG in Selenium Webdriver Hybrid Framework?

Suppose I am running scripts by reading data(including runmode) from an XLS and storing the results also in a new copy of the XLS, what exactly would be the role of TestNG in the framework? Please help.. Thanks in Advance!!
Rajesh
TestNG is not just to manage the way you read your input parameters/data etc. It actually does a lot more. Try to answer these questions -
- How do you invoke some method always on a Class load ?
- How do you invoke some method before/after each method within your test ?
- How do you tell which is your test ?
- How to generate an HTML based report based on the log statements you have ?
The answer to above queries (if TestNG was not there) would have been really complex and would require quite some coding experience.
As suggested earlier, please read the info about TestNG and how it can be efficiently utilized and then again try to answer the above questions in this post.

Is Excel-driven testing possible through selenium?

Sahi allowed me to enter the desired functions into a spreadsheet and then it would run those functions. Different combinations would result in different scenarios.Can i do something similar using selenium? I want to pick and call tests/scripts/functions through an excel file. I am currently using the testng framework to get data from excel files.
Thanks
Please check out the following blog for a relative answer on using data provider using TestNG for Selenium.
http://blog.varunin.com/2011/10/data-driven-testing-using-junit-and.html
There is no out of the box support. Spock framework has an excellent support for data-driven tests. A combination of PageFactory, Spock and Selenium2/WebDriver can provide you more than what you are looking for.
Sure, you could use a framework such as POI to read your Excel spreadsheet and return these values in a #DataProvider.

Resources