Tag Info

New answers tagged

0

If you're timing out, the WebdriverWait probably isn't finding anything - maybe a glitch in the XPath? Try validating it manually on the page. In the Chrome console, you can just use: $x("xpath here") Does that render any result? (I would've commented rather than replied, but I'm short two reputation points.)


0

There is a quote in front of the version. if you take it off your code should work i.e "version”:”6.1 should be "version”:6.1,


0

If this is for Java then why not use this project? https://code.google.com/p/fighting-layout-bugs/


0

Do two simple steps: First initialise webdriver element then try to find element using xpath, as explained below WebDriver driver=new FirefoxDriver(); driver.find element(By.xpath("enter your xpath")).click();


1

Ok, this isn't a bug. The XPath, when searching in the context of an element, must start with a dot. So this works: htmlControl = htmlDiv.FindElement(By.XPath(".//label[text()='Naam']/following-sibling::div[1]//select"));


0

There is nothing wrong with documentation. Need to specify page object classes as public classes.So moving GoogleSearchPage to different file and specifying it as public class should work fine. the way suggested here is also correct but is just an alternative.


-2

that was a performance defect above code is right.


0

According to Selenium best practices, XPath is locator of last preference. Preferred selector order : id > name > css > xpath Ask your web designers to add IDs or names to elements you need to interact with. Take them to the lunch and talk how IDs make your life easier. Bribe them is you have to.


1

There are some instances where selenium (watir) refuses to click a link or a button even when the xpath expression is valid and claims it found the object. In these situations I just use a jquery .click function with the .executeScript method as a work around.


0

As the very first step I would recommend exploring basic functionality of the tools. Luckily both Selenium and JMeter provide record-and-replay functionality so to start: Selenium IDE - Firefox Plugin which is able to record test flaw and generate relevant code. Preferred language is Java as both tools are Java-based and you'll be able to integrate it into ...


3

I am in no way trying to be rude, but I think the hiring team may be setting themselves up for failure. Having worked on many many automation projects and worked with many people of varying skill levels, it is actually just about impossible for someone with no automation background to jump in to automation and get it right the first time. With no guidance ...


1

The right way to go about it would be to prepare not just for the interview but for the job itself. Do you have hands on experience in programming? Try learning java. Both, selenium and jmeter work on java. So learn the concepts. Once you learn java, google tutorials for selenium and java. Learn from them. Ask help from the testing community for one on one ...


0

I'm using (when it is needs) mix of [FindsBy] and "complex" elements (defined as such "dummy example") protected string someVariable= "someXPath_part"; someVariable + "[" + number.ToString() + "]" As beekeeper said, driver.FindElement(By.Locator()) and locator, defined by [FindsBy] are equial, so if you need to check existing/enabling of element, just use ...


3

Yes, you can run headless with either Headless Chromium or with PhantomJS .. Keep in mind that running with Selenium Grid or SauceLabs is equally as good as running headless.


0

Why didn't you code your locator like this? driver.findElement(By.xpath(".//a/i[@class='icon-edit']")).click(); Seems like it would have still worked and would have been simpler.


0

Netbeans and Eclipse, you know, they are just an IDE. As far as I know, both of them do not have any official plugin(s) for Selenium, so I agree there isn't any difference. Anyway, consider your experience, I suggest Eclipse for you, because you can find plenty of blogs/web pages(etc.) to help you write test class.


1

It doesn't make much difference in terms of the development or scripting. But I prefer eclipse because netbeans tends to occupy a lot of memory and lower system performance. It seems to hang after a couple of hours. In that sense eclipse is more stable than netbeans.


1

Sometimes it so happens that the wait commands do not work. Instead of the wait command of selenium try using Thread.sleep(); command of java. This command will pause execution of the script for the given time...


0

If you're referring to an alert: driver.switchTo().alert().dismiss(); That will dismiss a JavaScript alert. If you're talking about a pop up that is a part of the application's functionality and it's not working in IE, that's a bug if you're supposed to support IE and that's up to the developer to fix. In any case, a pop up is usually dealt with using ...


0

Try to open this address in browser first to check server is up. Also another Web App can be launched or hosted on this address and port. Check Firewall settings, try to disable it and check the results.


0

How do you capture a screenshot using WebDriver or custom screenshoter ? May be the reason is in bad algorithm of getting screenshots after the test failures. Also you can try to update WebDriver to the newest version.


1

I found a workaround for this issue where I can check for the exception after each step using the [AfterStep] binding. This works for me, and tests that failed are now marked as inconclusive: [AfterStep] public void check() { var exception = ScenarioContext.Current.TestError; if (exception is WebDriverException ...


0

The same thing happens when I switch Chrome's default language. There are two solutions I can think of - manually add the Accept-Language: es header, or go directly to Google's Spanish version of the homepage - driver.get("http://google.es")


3

PageObjects The code of automated test cases should be easy to understand and not too complex. If a test fails, we want to know why and this as soon as possible. To allow this exists PageObjects. PageObjects are classes that contains WebElements and every actions associated with those. A PageObject looks like this: class HomePage { WebDriver driver; ...


0

It makes no difference. Both support JUnit and TestNG as testing framework. They also support Maven and Ant as build tools. In my view, all important things to develop automated test cases with Selenium 2 / WebDriver are present. My experience is, that NetBeans needs more time (just seconds) to start and use a little bit more memory. But seriously: it's ...


0

The place to start is the Selenium IDE. This is a Firefox plugin that allows you to capture a sequence of interactions using the Firefox browser. Once you stop recording, you then store the recorded steps as a test case. The Selenium IDE allows you to play back the test case that you recorded earlier. You will get a sequence of steps replaying in the log ...


1

True to edit user3783352's answer but got some permission error. So here is the content of the post referred to in that answer- package <Your Package>; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import ...


0

Great Answers, Adding few more pointers With basic coding knowledge and design basics we will be curious to know selenium specific approach for (iterating tables, uploading files) Selenium tips you should sign-up to understand know-how using Selenium. Identify to-do items for (beginner, intermediate, advanced). Often I have observed learning is useful when ...


0

If the pop-up window is part of the web-based app, that you are testing, you need to know why is only happening on FF and not on IE. There is a definitely a way on the settings on FF to disable pop up; however, IF in the future it is require to have pop-ups on your app, you will not have a user-oriented environment. Thus, I strongly suggest to not disable ...


3

Alan Richardson has a great beginner book called Selenium Simplified. A good solid way to learn with code examples is to use his Udemy courses and then follow up with Java for Testers. I had a background with PHP, JavaScript, and of course CSS and HTML before getting into Selenium. Java isn't compiled with WebDriver, it's parsed. There's a ...


1

Although learning programming and web-testing with Selenium from scratch as an autodidact is totally possible. I think you should find a team that does both manual and automated web-testing. Try to gather more experienced colleagues around you and work with them. If finding a team is impossible due to lack of actual real life experience I suggest you ...


1

To become an expert test automator using selenium and java a manual tester should do the following, Learn java. Learn selenium. What it does? How it does it? Learn the limitations of selenium. Get hands on practice with selenium. Learn tips and tricks to use selenium effectively and efficiently. Learn how to customize selenium to make it more suitable for ...


1

I can see several problems in your code. Paramaterized @BeforeSuite method with no data provider. Your @BeforeSuite method (main()) takes a parameter (args), but you have not told TestNG how to provide a value for that. That's what that exception message means. Calling test methods. When you run under TestNG, your @BeforeSuite method calls your test ...


2

Set up a FirefoxDriver. It's the best supported driver and supports advanced features. Automate a simple test such as opening a page and verifying the page contents. No form filling or JavaScript at this point! Run the test to verify it's working. This is necessary for the next step. After every subsequent step (except committing) make sure all the tests ...


1

Gestures - User can perform multiple clicks on submit button / search button occasionally which could result in page reloads / transactions cancelled Image / Video Previews - Between transitioning between thumbnail and playback of videos I have observed not well automated Payment gateway timeouts - During peak transactions there could be timeouts with ...


2

As I know captcha (Some captcha you can test) you can not test using selenium webdriver.


4

You mean to say in one class multiple methods you want to run, then use below code and try. @BeforeTest public static void beforeMethod() { driver= new FirefoxDriver(); } @Test public void main1() { driver.get("http://indianrail.gov.in/pnr_Enq.html"); driver.findElement(By.id("element")).sendKeys("1234567890"); String ...


0

Robot robot = new Robot(); robot.delay(3000); robot.mouseMove(x, y); robot.mousePress(InputEvent.BUTTON1_MASK); robot.mouseRelease(InputEvent.BUTTON1_MASK);


-1

You can use one single line to select the dropdown option. Avoid any extra line/code to click the dropdown. driver.FindElement(By.Id("DropdownId")).FindElement(By.XPath(".//option[contains(text(),'OptionText')]")).Click();


0

It'll be difficult without the code you're using. Other helpful items would be if there's a browser that the test always works on, and what version of Selenium you're using. That said, are you testing for your WebElement being visible and enabled as well as not null before you click? If it's in a clickable state (for example, visible, but disabled), ...


0

You can try this code milinpatel17.wordpress.com/2014/07/02/web-page-link-test-using-selenium-webdriver It has worked very well for me..


0

The exception is not related to HTTP Basic Authentication, i.e., is not about missing authentication credentials. This also has nothing to do with broken links. This bizzarre exception message is saying that in your truststore you do not have certificate of the Web site you want to connect to, so simply that you do not trust this site. Now the solution ...


1

@Subbarao: These links may help for you, Link1, Link2 and Link3



Top 50 recent answers are included