New answers tagged

1

// GIVEN that I am an anonymous user on the Instruct Counsel page driver.get("https://www.lexology.com/instructcounsel/find"); // WHEN I press the Example button driver.findElement(By.xpath("//div[@id='do-example-search']/button")).click(); driver.get should wait for the page to load, but that doesn't mean the button is ready to be ...


-1

If an xpath refers multiple elements on the DOM, It should be surrounded by brackets first () and then use numbering. if the xpath refers 4 elements in DOM and you need 3rd element then working xpath is (common xpath)[3]. If you are beginner and need more clarity watch https://youtu.be/k-znmPHjTF0


1

there is a best practice when "There are good practices in context, but there are no best practices." When you first create the LoginPage object, it has the context of the first landing on the page. It may have loaded internal information relevant to this first landing (which the tests don't need to know). When you perform login and logout and ...


1

ChromeOptions chromeOptions = new ChromeOptions(); String proxyadd = "176.9.119.170:8080"; Proxy proxy = new Proxy(); proxy.setHttpProxy(proxyadd); proxy.setSslProxy(proxyadd); chromeOptions.setCapability("proxy", proxy); WebDriver driver = new ChromeDriver(chromeOptions); There is a proxy class that can be used to set proxy including ...


0

Try to get the attributes of the webElement2 which you are referring at your code. String aa = webElement2.getAttribute("text").toString();


0

try List<WebElement> list = driver.findElements(By.tagname("option")); list.get(<index number of the selection>).click();


0

package extendreport_2; import org.json.JSONException; import org.json.JSONObject; public class printsomething { public static void main(String[] args) { // TODO Auto-generated method stub try { JSONObject jsonObject = new JSONObject("{\"header\": [\r\n" + " {\r\n&...


0

As per my experience in a professional automation testing services organization, I will suggest you to use one of the below tools as per your current configuration i.e. Selenium / Maven / Java / IntelliJ Idea - TestNG - It is an automation testing framework which provides default HTML reports. Extent Reports - This report besides a consolidated execution ...


1

There are plenty. For example, if integrating with Jenkins, there's the Selenium HTML Report which allows you to drill down in the summary as well.


0

Use wait() method properly so that the desired element is visible/present. Your code seems okay. You can recheck the xpath of button. Use click() method instead of sendKeys(Keys.RETURN); // Click purchase button driver.findElement(By.xpath("//*[@id=\"chakra-modal--body-630\"]/button")).click();


Top 50 recent answers are included