Hot answers tagged

11

Do you think that time is the problem here? If so try to increase the time you are providing in Thread.sleep(); and see it that works out for you. If its not the time, then did you try to find out what the problem is? Are you getting any error?


5

Yes, you can use NUnit for functional testing. But still it is a unit-testing framework. No, you are not creating unit-tests by using a unit-testing framework to write functional tests. A unit-test is testing just a single methods input and output, by writing end-2-end tests it by definition cannot be a unit-test. :) Unit testing frameworks are often ...


5

The JSON Wire Protocol is on it's way to becoming accepted as a W3C standard. This means that moving forward, the vendors behind browsers will have much more incentive to implement and maintain implementations for their browsers. Some vendors such as Mozilla and Microsoft have already taken over maintenance of the drivers used by Firefox and Edge. I heard ...


4

According to The WebDriver Sampler: Your Top 10 Questions Answered article the information can be obtained from Selenium Changelog, for instance for Java client libraries: v2.52.0 ======= Firefox: Weakening platform restriction to enable 64-bit support Fixing closed window handling in FF45 So my expectation is that version 2.52 ...


3

When is a good time to develop new automated test, and who should be responsible for this? Developing the structure of the automation can begin very early on in the process. Once the requirements are set the objects can start getting built out, be put into classes and a lot of the assertions can be built that way all that remains is ToDos that hook into ...


3

I got the same issue when I use Firefox 39 with Selenium 2.45. After that I upgraded to Selenium 2.46 and the issue got resolved. I think that the problem is the Firefox and Selenium version agreement. Note: the default setting will make the Firefox update automatically.


3

We have found that dealing with third party software in CI/dev environments was a great source of intermittency/failure and pain. So in our CI environments, we always create stub services for third parties. A stub service is basically a fake API service that you control, that behaves the same (or similar) to how the real service does. I would recommend ...


3

Agreeing on good element and attribute identifiers is essential with web applications. Identifying elements is done by developers, designers and automation programmers. In a traditional waterfall environment with most of the requirements and specifications placed up front you can agree that, for example all elements that will be used, checked, clicked on ...


3

One possible way is to force a change in a parallel session or in the database with a script. Then you can keep polling for some seconds until the new data becomes visible. I would expect the feature is not to refresh the page, but to refresh to show new data. Test the feature, not only the known behavior, thus test why the page refreshes instead. Ask ...


2

Webdriver is faster, as compared to RC Webdriver mimics much more closer to real-life interaction; as compared to RC WebDriver supports more languages WebDriver is more actively followed/supported now; RC is past details: http://www.guru99.com/introduction-webdriver-comparison-selenium-rc.html


2

I think you can change the settings of Firefox so that it just download without showing a download file dialog. https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file You cannot handle native OS dialogs with Selenium IDE, if you can't disable the download dialog, then your only option is dropping the IDE and writing Selenium tests in ...


2

I believe you are getting this error because : You are immediately (before the page load could finish) searching for an element and finding it. there are 3 options in a dropdown and on selecting each option, rows in a table gets populated. When dealing with asynchronous pages use proper waits after every anticipated page-load. Insert an explicit ...


2

Ask your developers to add a name (which does not need to be unique) to relevant elements. find_elements (Java may have different spelling) returns a LIST of elements. If you cannot have name, you can find by CSS class. Xpath is locator of last hope, too brittle and too slow.


2

Using a similar logic to what you already have I would simple loop through based on your xdoc. using System.Xml.Linq; XDocument xdoc = XDocument.Load("uielements.XML"); string name = "'ele_child123'"; string find = "//element[@name=" + name + "]"; foreach (var childElem in xdoc.XPathSelectElements(find)) { string childName = ...


2

If you're talking about bringing the browser's window within the OS to the foreground. Selenium cannot do that. You need to introduce a library that is able to automate actions on an OS level. Selenium is restricted by javascript's same origin policy. Looks like you're using Java, so you could take a look at awt.Robot. But be aware that any solution you ...


2

Try using //li[@class='moreGenres']/span as an xpath For css, what you have - .moreGenres>span does work - so see if maybe you have that li in more than one place perhaps? or maybe make it a bit more specific such as li.moreGenres>span or ul>li.moreGenres>span or (better) ul.this_list>li.moreGenres>span It might also be ...


2

I've been using Ranorex for web automation testing purposes for 3+ years now, and I can say it's the best UI automation tool I've used so far. The application under test is a fairly huge site, where the end users can create individual accounts, but also enterprise ones that, depending on the account type, have a LOT of options that can be tweaked, ...


2

Instead you should create Firefox profile in order to invoke it locally. Refer this : http://www.howtogeek.com/209320/how-to-set-up-and-use-multiple-profiles-user-accounts-in-firefox/ This should resolve your problem.


2

Since you are using CodedUI for this I would write something like this. public static void GetAllElements(BrowserWindow bw) { var a = bw.GetChildren().Where(x => x.GetProperty("TagName").ToString() == "TD"); foreach (var control in a) { Console.WriteLine(control.Name); Console.WriteLine(control....


2

The point is the relative offset to the found control, thus it is not depended upon screen resolution or anything. Coded UI first finds the control and then the mouse.click adds an offset, then same you clicked when U recorded it. Read more about it here: https://blogs.msdn.microsoft.com/mathew_aniyan/2012/03/16/faq-why-are-we-using-coordinate-based-actions-...


2

(This was meant to be a comment, but I do not have enough rep to do so) If you can find the ComboBox within your page, you should be able to iterate over all of the different options. If you can do that you should be able to check the ValueAttribute within the option. Once you find the option that you would like to select, you should be able to set the ...


2

After getting idea from Tango199 answer, I modified his solution and have now implemented below code (once ComboBox is found): HtmlListItem html_listItem = new HtmlListItem(html_comboBox); html_listItem.SearchProperties.Add(HtmlListItem.PropertyNames.ValueAttribute, str_Value); html_listItem.Select(); where str_Value = Value Attribute (like 7311, 7312) as ...


2

1: Select Cdropdown = new Select(driver.findElement(By.xpath("//select[@id='ClientId']"))); Cdropdown.selectByVisibleText("centralpen-ak-01"); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); Select Edropdown = new Select(driver.findElement(By.xpath("//select[@id='EnvironmentId']"))); Edropdown.selectByIndex(0); //...


1

Below is a way to list URLs, you can change the By.tagName to your required selector like By.id WebDriver driver = FirefoxDriver(); driver.get("www.google.com"); List<WebElement> elements = driver.findElements(By.tagName("a")); Hope this will help you out.


1

I got the solution for the above issue, the code line html_hyperLink.SearchProperties.Clear(); was causing problem, after removing this line test cases are working fine as required.


1

I see two possible intepretations of your question here. The first is "How can I improve the speed of how elements are found on a page?". Another is "How can I improve execution speed of my suite of tests?". The first question has some answers already. You've found that xpath vs id doesn't provide much speedup, so you're almost at the end of the road there....


1

I run my Coded UI tests from the commandline with /Logger:trx this generates a .trx file vstest.console.exe "MyApp\Debug\MyApp.CodedUI.Test.dll" /tests:TestCase1,TestCase2 /Logger:trx You find the vstest.console.exe in your VS directory: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\


1

Click on Upload File Copy your Path in Clipboard (as Shown in the code) Press Ctrl+Vand hit Enter using robot class StringSelection selection = new StringSelection(file); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(selection, selection); robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_V); ...


1

The chart looks like an SVG chart. So you would need to go to the particular bar and then get the tool tip using the .text attribute - if you're using Python or using the getText( ) -in case you're using Java. Here is an example of such a chart (it's a pie chart) SVG Pie Chart Here is how I got the tool tip text for the Violet portion of the pie chart : ...


1

Is NUnit only a Unit testing framework? NUint is a .Net port (commonly used with Visual Studio) of JUnit (which is commonly used with Eclipse). So it's different than the standard 'unit tests' in a VS project. Generally those unit test are testing each function of the application. xUnit tests do test through the UI level. I think your hangup is on the term ...



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