Hot answers tagged

5

Simpler solution is try a waitFor() on your process, this waits until the process exits. @Test (priority=1) public void CreateNew() throws Exception { Process process = Runtime.getRuntime().exec("exeFiles\\CreateNew.exe"); process.waitFor(); Integer result = process.exitValue(); Assert.AssertEquals(0, result) } Now you can add an ...


5

Sharing credentials You should never share your credentials with others. Keep those private. Use the tools provided by git(hub) to give others access to your repository. How to give others access You can invite users to become collaborators to your personal repository. Repositories owned by an organization can grant more granular access. For more ...


3

Selenium is used for automating user-browser interaction with the HTML and Javascript on websites. It does not have any functionality to test databases other than indirectly through web applications and HTML pages. Per http://www.seleniumhq.org/ "Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for ...


3

You can't click hidden elements with Selenium. However, you can trigger the click through Javascript, as found on SO: JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("arguments[0].click();", element);


3

Understand - Cause why this occur Any of your file is present at the compile time but its not reachable at the execution time You need to crosscheck both compile time and run time environment & class paths


3

The prerequisites for starting the object mapping mode are: project is created and opened a connection has been made to the AUT Agent (if this is successful, the "Stop AUT Agent" button on the toolbar will be enabled) an AUT has been configured via the project properties the AUT has been started. Your AUT is successfully started if the AUT can be seen to be ...


3

You seem to have "else" twice near the end of the code snippet. On some other things that I would change: You call time.sleep() twice at the start of the code, one right just after the other Remove time.sleep() altogether and wait until a certain element is shown instead. You can either set implicit wait globally, which will affect all of the webdriver`s ...


2

The solution wasn't to delete the java path or to delete the java.exe and javaq.exe files - it was pretty much the opposite! After uninstalling and re-installing JDK 8 (which took me to Update 40), I added the PATH variable and directory to environment variables, which was the same as before, so I guess there was a version incompatibility which update 40 ...


2

Hopefully you are using a test framework like testng on spock, if you are then plugging it into a remote jenkins and show the status in jenkins should be your standard approach. If trust is an issue you can have selenium take screen shots at key points along the way (or even in the afterMethod method). One thing we ran into with jenkins though is selnium ...


2

Eclipse and Intellij(Community Edition) are open source. Intellij refactoring support is better. IntelliJ IDEA is way powerful than Eclipse, It has the best autocomplete (intellisense). Its better to play with both and compare. for C# you have to use Visual Studio. This question asked before


2

It is a personal preference: You can find out more information about IntelliJ and Eclipse here: Why IDEA is better? Eclipse, NetBeans or IntelliJ: Which is the best Java IDE? How is IntelliJ better Things possible in IntelliJ but not possible in Eclipse If you want to program in C#, simply get Microsoft Visual Studio Community Version.


2

You are initializing chrome in a wrong way. In your code you have maximized browser and called the URL, before even setting up the chrome profile. You can give a try to below code: System.setProperty("webdriver.chrome.driver", "E:\\Selenium Jar\\chromedriver.exe"); ChromeOptions options = new ChromeOptions(); options.addArguments("--...


2

Define the webdriver at the class level and then call the same webdriver instance on each and every test method.


2

Here is the step-by-step procedure to perform the scenario: Setup a Jenkins server if already not using. Goto plugin-manager of Jenkins to install “SonarQube Plugin”. Goto “System-configuration” of Jenkins to provide “SonarQube” server’s details Create a Jenkins job and choose one source code management option (say git). Under build, add “Execute Shell” as ...


2

A few corrections which will not directly solve the issues you're facing, but will put you in the right direction. About your robotframework source: The settings names are actually Test Setup and Test Teardown (single words) To use a library, like the Selenium you'd like to, it has to be "imported" - e.g. again in the *** Settings *** section, add it as ...


2

Possible error : Old configurations Already chromedriver process is open and occupied port Solution : 1. Use latest files : Java 8 Selenium 3.4.0 (Latest one) Chromedriver (Latest one) Note : Clean your project before use. 2. Sometimes already opened chromedriver process blocked the ports : Run command to kill all process related to chrome ...


2

I actually found out how to do it: I created a .java file within src/main/java/mycompany and added a method that sets up the property: package mycompany; public class Setup { public void browserSetup() { System.setProperty("webdriver.chrome.driver", "C:\\path\\to\\chromedriver.exe"); } } Then, in my test, I imported this as a library: ***...


2

Not a big difference. When you add JARS in eclipse build path you have to find those jars in the network, download the proper version, place them on your hard drive, set up the config in Eclipse. Then you might change your mind about the required version, you have find new version in the network, then download, then place jars to your hard drive, then ...


2

The message Element <div class="tab iconic tab_nav_account " id="account_button">...</div> is not clickable at point (924, 28). Other element would receive the click: <div class="v-center-inner">...</div> shows, that your test case order to click on the element, which is present and displayed, but it is not clickable because is ...


2

Well at last the Issue is been resolved. All I have did is in eclipse, just renaming the file "TestRunner" to "TestRunnerTest". Command Line: java -cp "E:\Workspace2\AP\Jars\*;E:\Workspace2\AP\bin" cucumber.api.cli.Main --glue stepDefinition E:\Workspace2\AP\Feature\LogIn_Test.feature Thanks to Koen Prins answer, Reference here: https://groups.google.com/...


2

When testing objectives are unclear (and often even if they are) I go to our generally accepted standards: Have cases for the following types of tests and tag them accordingly Smoke - basic page loads Happy - perfect user, functions work Sad - user makes mistakes Compliance - audit/legal requirements Optional - non-required workflow I also look at the ...


2

If I have understood your question correctly, then following are the changes that you need to do: 1. The method setfirstname is not a Test method, so remove the @Test annotation. 2. The method valid under the Validdata class is a Test method so add the annotation @Test(dataProvider="first", dataProviderClass=CommonElements.class) So your test method looks ...


1

//Getting the WebElement. WebElement errormsgforoldpass = driver.findElement(By.xpath("//span[@class='field-validation-error']//span[@for='OldPassword']")); //Getting the text of the webelement. String erroldmsg = errormsgforoldpass.getText(); //Printing the text of the webelement. System.out.println("errormsg->"+erroldmsg);


1

If you really want to test the database, and assuming you're using MySQL, then the most convenient way to do it is to use their testing framework: https://dev.mysql.com/doc/mysqltest/2.0/en/. Skip Selenium, Eclipse, etc., they're not the tools for this job, as Michael already pointed out.


1

you should be able to override the report creation by creating your own implementation of IReporter interface: import java.util.List; import java.util.Map; import org.testng.IReporter; import org.testng.ISuite; import org.testng.ISuiteResult; import org.testng.ITestContext; import org.testng.xml.XmlSuite; public class CustomReporter implements IReporter{ ...


1

In package explorer->test-output->right click on emailable-report.html file and open with texteditor. change name by default(Parameter#1) to "Name"


1

There are several customized report tools available in market. Also you can use some API like ExtentReport which is also useful and most of the functionality is given by default. Lets come to question, Please refer this link. Here you can add some lines of java code to add or remove the result of TestNG report. As per my practical example TestNG by default ...


1

As per your configuration link that provided in comment , There is step num 3 is missed. Please update testng.xml to <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "testng.org/testng-1.0.dtd">; <suite name="Report Suite" > <listeners> <listener class-name="org.uncommons.reportng.HTMLReporter"/> <...


1

Assertion : Assert is implemented to verify expected and actual result. If Assert failed, It will terminate the script and it will not execute further code/test or any other block Try & Catch blocks : Try and Catch blocks are used mainly to take action if errors & exception which might occur during execution Just provision to handle those error ...


1

That is actually a sort of bad practice to distribute WebDriver.exe within your java program, since it will stale after the browser will get updated. You also won't be able to run the exe file straight from the jar file. However if you have no options I can suggest the following way: Put your exe file to resources folder Within the code implement copying ...


Only top voted, non community-wiki answers of a minimum length are eligible