automated-tests

Shared Unit Tests with MSTest

北慕城南 提交于 2019-12-12 18:35:27
问题 I have approximately 5-6 reports, they are structured the same, using Watin, I'm testing each one of these reports. I have a shared test, I call "ReportBaseTests".. public class ReportBaseTests { public string MenuName { get; set; } public ReportBaseTests(string name) { this.MenuName = name; } [TestMethod] public void Perform_Invalid_Date_Range() { } } but in each of my tests, I have... [TestClass] public class Report1Tests : ReportBaseTests { public Report1Tests() : base("Report 1") { } }

How to get Response Data and parse it to HTTP Header Manager in JMeter

寵の児 提交于 2019-12-12 18:27:22
问题 I have run Login sampler and I get the result like this [Login Sampler Result Data][1] Here, I want to take "access_token":"91kLM68tdMBoDFRURArvdmwYgWV9Nr2sHYDwivTM" and save the "91kLM68tdMBoDFRURArvdmwYgWV9Nr2sHYDwivTM" to a variable, then parse that to HTTP Header Manager here where I want to parse the variable I am using JMeter version 2.13 Help me please. 回答1: First of all add an regular expression extractor under login sampler (right click on login sampler --> Add--> Post Processor-->

Nightwatch(PageObject) access elements from different page object

雨燕双飞 提交于 2019-12-12 18:20:31
问题 Is there a way to access elements defined in one page object file from another page object file? Example: If we need to access '@usernameInput' from LoginPage.ts file, do we need to duplicate it from HomePage.ts ? Is there any other way? HomePage.ts const page: PageObject = { url: ..., commands: [ enterUsername: (query: string) => { return this .waitForElementVisible('@usernameInput') }], elements: { usernameInput: { locateStrategy: 'xpath', selector: '//input[@name="Username"]', } };

Not able to switch to iframe using Selenium webdriver

点点圈 提交于 2019-12-12 17:27:10
问题 I am trying to click on SIGN IN link which is placed inside the iframe with class attribute "modalIframe". I have been trying for the past two days to find a solution for this but not able to. Any help would be really appreciated. Code as below public class Datereader { public static void main(String[] args) { System.setProperty("webdriver.gecko.driver","C:\\Users\\Madankumar\\Desktop\\Gecko Driver\\geckodriver.exe"); WebDriver driver=new FirefoxDriver(); driver.get("https://www.redbus.in/");

cant click button which opens file attachment dialog

荒凉一梦 提交于 2019-12-12 16:36:54
问题 i'm usinng selenium 2 beta . i'm trying to click button which opens file attachment dialog. but when i click it nothing happens. <input class="zf" name="Passport" id="PassportUpload" type="file" onclick="return { oRequired : {} }" maxlength="524288"> driver.findElement(By.name("Passport")).click(); using just selenium not selenium 2 i can click it easily. 回答1: I guess that the issue is only when using Internet Explorer since IE and FF handles the File Input slightly different: in FF you can

How to Structure CRUD Tests using BDD

折月煮酒 提交于 2019-12-12 14:15:55
问题 I'm stuck at a bit of a quandary trying to figure out the best way of structuring my CRUD tests. Within my application users have the ability to create several types of 'tasks'. My currently implementation looks something like the following: Scenario: Create Task-Type A Given I am on a user's profile page And Have access to create tasks When I create a new task with a unique title and description Then The confirmation prompt should display Scenario: Read the Task-Type A Given A new task was

When unit testing, how should one handle testing the initialization of objects?

风流意气都作罢 提交于 2019-12-12 13:41:35
问题 So with most unit testing utilities I have come across, you usually get access to a SetUp() and TearDown() function of some sort. While I see that this comes in very handy for almost every unit test, I was wondering how testing the initialization of objects should be handled? I mean, in almost every other test, you would just let the SetUp() function handle it. However, in most of the basic testing utilities I have worked with, SetUp() gets called before every test. I have been wondering if

How to run multiple test methods in same browser instance without closing it (C#, SeleniumWebDriverz NUnit)?

a 夏天 提交于 2019-12-12 13:18:49
问题 I am beginner with c# and Selenium. I am wondering if it is possible to run multiple [TestMethod]-s in same browser instance without closing it? For e.g. after "Can_Change_Name_And_Title" is finished, I want to continue with "Can_Change_Profile_Picture". [TestMethod] public void Can_Change_Name_And_Title() { SidebarNavigation.MyProfile.GoTo(); ProfilePages.SetNewName("John Doe").SetNewTitle("New Title Test").ChangeNameTitle(); } [TestMethod] public void Can_Change_Profile_Picture() {

Writing message in Coded UI HtmlLogger output file

ぐ巨炮叔叔 提交于 2019-12-12 13:13:21
问题 I am using Coded UI for Automation testing. I have already enabled HtmlLogger in QTAgent32.exe.config file. I am getting the html output file. but I am considering to write some messages in that html output file. I used this.TestContext.WriteLine("Message"); to write output in result file (.trx) but it is not writing in output html output file. Is there any solutions to write in html file while test is running? Any help would be highly appreciated ! 回答1: I found that there is no direct way to