Hot answers tagged

2

As I understood the question, it is required to define the reusable methods and use those methods in different test cases based on the requirement. Here I am writing the code for two individual methods to work with,... public void inputKeys(WebElement we,String ip){ we.sendKeys(ip); } The above code just type the string value referred by ip variable. ...


2

Try to form the Xpath like //div[@class='promptChoiceListBox']//input[@id='saw_3005_7_1'] Please check the script by finding the element with the above Xpath. Hope it will work because if you take only div tag it will give entire drop down ,but we just need to click on the drop down symbol button in the region of your image added above.


1

Try this First click on the div element. This should open the drop down. Webelement ele1 = driver.findElement(By.XPATH("//div[@class='promptChoiceListBox']")); ele1.click(); Now we need to implement some kind of wait here so that we have a time gap to allow the elements to load //implement some wait here so that element appears WebDriverWait wait = ...


1

In excel sheet always start with 0-column and 0-row and index 0 as well. Change data[i][0]=conf.getData(1, i, 0); data[i][1]=conf.getData(1, i, 1); data[i][2]=conf.getData(1, i, 2); to data[i][0]=conf.getData(0, i, 0); data[i][1]=conf.getData(0, i, 1); data[i][2]=conf.getData(0, i, 2);


1

This is super odd, in terms of your code though, everything looks correct. the problem does not seem to be on your end. If you call the click method, and selenium times out AFTER the browser performs that click, then the problem is likely with the return trip from the browser's embedded http server that your tests communicate with. Your stack trace also ...


1

Problem solved by this steps: Changed cookie Policy to compatible Changed cookie Implementation to HC3CookieHandler and the last but not least, Internet Explorer Driver has got some problems with getting cookies named, changed to Chrome Driver and now everything works


1

It will be good to do this with firepath, it works well for Firefox browser. And once you know the path you can implement the same (litle changes might be need for explorer though) for other browsers. Please check the link, it has a better explanation for locating an element



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