Posts

Showing posts with the label selenium-webdriver

Selenium and Java: How do I get all of the text after a WebElement

Image
Selenium and Java: How do I get all of the text after a WebElement I am coding a program in Java using WebDriver and am having a little bit of trouble getting the text after the select webElement. The HTML code for the part of the website that I want is as follows: <div id="content"> <div id="Pagination"></div> <div id="mid"> </div> </div> The textbox class codes for a search bar and a drop down bar of languages My Java code is currently able to open chrome using the chrome driver and is able to type into the search bar. I am however not able to get the text that results from the entry. Image In the image here, I entered "avoir" into the search bar, and I want all of the text inside the boxes after which do not seem to have any id's or names to be used inside the xpath. Can someone please help me in finding how to get and save the text from those fields after the dropdown l...

Exception in thread “main” java.lang.Error:Unresolved compilation problems: working with selenium

Exception in thread “main” java.lang.Error:Unresolved compilation problems: working with selenium I am a begineer in selenium and trying my own after installation of eclipse, java, selenium, TestNg and started writing the below code. Exception in thread "main" java.lang.Error: Unresolved compilation problems: WebDriver cannot be resolved to a type FirefoxDriver cannot be resolved to a type at Mypackage.MyClass.main(MyClass.java:8) package Mypackage; public class MyClass { public static void main(String args) { WebDriver driver = new FirefoxDriver(); String baseUrl = "http://google.com"; String expectedTitle = "Welcome: Hello"; String actualTitle = ""; driver.get(baseUrl); actualTitle = driver.getTitle(); if (actualTitle.contentEquals(expectedTitle)) { System.out.println("Test Passed!"); } else { System.out.println("Test Failed");...

Why getting error failed to parse pom?

Why getting error failed to parse pom? while building project via jenkins getting below error. Building in workspace C:Program Files (x86)JenkinsworkspaceJenkinProject Unpacking https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip to C:Program Files (x86)Jenkinstoolshudson.tasks.Maven_MavenInstallationTestMaven on Jenkins ERROR: Failed to parse POMs java.io.IOException: Failed to rename C:Program Files (x86)Jenkinstoolshudson.tasks.Maven_MavenInstallationTestMavenapache-maven-3.5.3 to C:Program Files (x86)Jenkinstoolshudson.tasks.Maven_MavenInstallationTestMavenapache-maven-3.5.3.__rename at hudson.FilePath$29.invoke(FilePath.java:2107) at hudson.FilePath$29.invoke(FilePath.java:2100) can you check what files are there at C:Program Files (x86)Jenkinstoolshudson.tasks.Maven_MavenInstallationTestMavenapache-maven-3.5.3 location – Pramod Jun 30 at 14:30 ...