New answers tagged

0

You should use xpath. If your text 'IPS' is the text inside tag use this: //*[contains(.,'IPS')]. If 'IPS' is for example part of @class atrribute use this: //*[contains(@class,'IPS')]. If 'IPS' is always at the begginig of the text you can use starts-with command instead of contains. Unfortunately web browsers dont support Xpath 2.0 which provides ...


0

Use contains() or starts-with() function in xpah : Solution : With contains : //*[contains(@id,'IPS')] With starts-with : //*[starts-with(@id,'IPS')] Where * means any element. Let me know If any query.


0

You can also select dropdown option by value WebElement userContractType = driver.findElement(By.xpath("//select[@id='user_contract_type_of_contract']")); Select selectValue = new Select(userContractType); selectValue.selectByValue("775");


2

Use Select method in WebDriver- WebElement contractType = driver.findElement(By.xpath("//select[@id='user_contract_type_of_contract']")); Select dropdownField = new Select(contractType); dropdownField.selectByVisibleText("Contract onbepaalde duur"); OR // Select by using index starting from 0 to ...you have to select 2nd option so take as index-1 ...


0

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 ...


0

Why not Both (Or well, all three)? So, you create a clickMale, clickFemale and clear function. You can have a function that takes in a boolean that will click male or female based on the value of that boolean using the functions that were created.


2

I'd avoid implementing the class twice. I would simply test the original implementation i.e. MultiFilesIterator class with real files dedicated for the tests. The class is simple enough to test directly, and seems to be designed to specifically work with files, so I think the extra level of abstraction is redundant here. This would also keep your testing ...


0

I hope this line of code helps you public String xls2text(InputStream in )throws Exception{ HSSFWorkbook excelWb = new HSSFWorkbook(in); StringBuffer result = new StringBuffer(8192); int numberOfSheets = excelWb.getNumberOfSheets(); for (int i = 0; i < numberOfSheets; i++) { HSSFSheet sheet = excelWb.getSheetAt(i); int ...


1

I found a solution that requires no browser profile with a client certificate preconfigured but rather test must provide the certificate. The downside is that it is based on PhantomJS Web browser implementation, not on Firefox or Chrome. You just need to install version 2.1.1 version or later. A client certificate can be provided with the following ...


0

Check with different xpath & use implicitly wait instead of 'Thread.sleep' -See below driver.switchTo().frame(driver.findElement(By.id("frmmenusuperior"))); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); WebElement menu = driver.findElement(By.xpath("//li[@id='i_ACAD']/a")); Actions actions = new Actions(driver); ...


0

I have set up a similar utility using JUnit test cases. My framework used Groovy/Spock with listeners that reported results into a Couchbase DB. From there the tests were displayed on an AngularJS site which had the options to run either the selected test or run all test cases. I have posted the API portion of the code here which should not be overly ...


2

You do not need Eclipse, Jenkins, or TestNG to scrape a website. Ask a software developer to help you package Selenium, your Java code, and any other necessary resources into an executable Jar file. If you can't find any developers, try Googling for "executable Jar file". Your executable Jar file will require a main class. If you are accustomed to ...


1

With JUnit I have set up a web-based runner/control unit that allows the end user to access and run the tests. It is extremely primitive and it would run on the server instead of on their machine but here is the code that I used in order to achieve this: @Stateless @Path("test") class TestsService { @Context UriInfo ui; @GET ...


0

My robot tests broke completely when updating firefox from 44.0.2 to 45.0.2. With selenium server 2.49.0 FF 44.0.2 still works fine. Latest version of selenium-server 2.53.0 also does not work with my robot tests. Although I think it's down to the Selenium2Library needing an update...


0

By using Parameterized Tests you should be able to achieve your desired results. By adding something similar to the following: @Parameters public static List<Object> data() { List<Object> data = new ArrayList<Object>(); cellRow = 2; while(str != "End of Data"){ data.add(ExcelUtility.getRowData(cellRow)); } } And ...


0

Use this xpath for your selection //md-select[contains(@id,'select')] Contains function use for finding containing values. Refer This Let me know If any query.


3

According to The WebDriver Sampler: Your Top 10 Questions Answered article the information can be obtained from Selenium Changelog, for instance for Java client libraries: v2.52.0 ======= Firefox: Weakening platform restriction to enable 64-bit support Fixing closed window handling in FF45 So my expectation is that version 2.52 ...


0

There are two alternative methods of performing the task you require; driver.Navigate().GoToUrl("http://example.com"); and driver.get("http://www.google.com"); navigate().to() Navigate().GoToUrl and get() do exactly the same thing so it really comes down to which works for you and fits your coding preferences.


1

I'm not sure about -most- stable but I'm running it with the latest version of Firefox (45.0.1) and none of my scripts have stopped working.



Top 50 recent answers are included