[Solved] What does the statement Object[][] data = new Object [][] mean?

In this statement Object[][] data = new Object[sheet.getLastRowNum()][sheet.getRow(0).getLastCellNum()]; It is creating an array of references to arrays of references to Objects. The first array is for rows and the leaf arrays are for column values. In reality, only String objects are added so I would write it like this. int rows = sheet.getLastRowNum(); int columns … Read more

[Solved] Selenium – How to confirm that captcha with two numbers are changed after submit [closed]

Here is the line of code that you have to use the before clicking submit and after clicking submit. Then compare they are not matching. driver.findElement(By.xpath(“//span[@class=”et_pb_contact_captcha_question”]”)).getText(); 0 solved Selenium – How to confirm that captcha with two numbers are changed after submit [closed]

[Solved] How to solve java.lang.NoClassDefFoundError? Selenium

The error says it all : java.lang.NoClassDefFoundError: com/google/common/base/Function at MainTest.openGoogle(MainTest.java:15) While working with Selenium v3.x you have to download geckodriver.exe from mozilla/geckodriver and place it in your system. Next you have to set the system property through the line System.setProperty() as follows and provide the absolute path of the GeckoDriver binary within your system as … Read more

[Solved] How to resolve the Exception in thread main

From your code it seems you are switching to a frame in getIframe. But forgot to switch to default[ driver.switchTo().defaultContent();] once your opertation is done public String getIframe(String id) { String Value = “”; final List<WebElement> iframes = driver.findElements(By.tagName(“iframe”)); for (WebElement iframe : iframes) { if (iframe.getAttribute(“id”).equals(id)) { driver.switchTo().frame(id);//switch happens Value = driver.findElement(By.xpathdfdgdg”)).getText(); System.out.println(“erer” + … Read more

[Solved] How to retrieve integer value from field in selenium?

Looking at your code you are trying to print the element itself. System.out.println(FatherNum); If you want to print the value of that field , you can do it by : System.out.println(FatherNum.getAttribute(“value”)); OR String Fathernum= FatherNum.getAttribute(“value”); System.out.println(Fathernum); See the doc for getAttribute – see link 1 solved How to retrieve integer value from field in selenium?