New answers tagged

1

My current Solution. Parses through the HTML file (C:\QA\Test.html), finds all input tags and Select tags, if they have an ID it will convert them into a POM based format. It then prints out to C:\QA\Pom.txt the basic object for it. Overall, it does 90% of the work that I need, with minor editing. using System; using System.Linq; using System.IO; using ...


1

One non-selenium tool we use (we use the paid version) is GhostInspector which has several options for screenshots including comparing by % difference and by css selectors to target areas.


0

One option for verifying images is to use Applitools + Selenium. It seems to be gaining in popularity among the Selenium crowd as it's not just able to do image comparison but also do layout comparisons. I haven't used it myself but it's on my TODO list. From the looks of it, they have a decent tutorial where you can choose your environment (Selenium) and ...


0

At this situation We have lots of options- Option 1 : Look for any other attribute which Is not changing every time In that div node like name, class etc. So If this div node has class attribute then we can write xpath as bellow. //div[@class='post-body entry-content']/div[1]/form[1]/input[1] Option 2 : We can use absolute xpath(full xpath) where you ...


1

Use Sikulix API. Sikuli is a library that will help you compare two images or recognize images when they are displayed on your screen. After the said image is displayed, you can click on the recognized image. Download Link: http://www.sikulix.com/ Go for the download link: https://launchpad.net/sikuli/sikulix/1.1.0 Download sikulix-setup-1.1.0.jar Run ...


2

Selenium is a software library to locate elements on web page and interact with them. To deal with images, you need to use different library. Selenium can provide screenshots (images) but you need to use something else to work with such images. As a programmer, you need to master more than a single library, and learn to use right tool for the job.


1

You can calculate hash of images and then compare the hashes for equality. SO has a question on calculating hash


0

Check this code might work import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; import java.io.File; import java.io.IOException; import java.util.concurrent.TimeUnit; import javax.imageio.ImageIO; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import ...


2

Use contains() or starts-with() function in xpah : Solution : With contains : //div[contains(@id,'post-body')]/div[1]/form[1]/input[1] With starts-with : //div[starts-with(@id,'post-body')]/div[1]/form[1]/input[1] Let me know If any query.


0

Use this xpath: //div[@class='ViewMenu' and text() = 'Videos'] because class selectedViewMenu is probably only when element is selected.


1

WebElement element=driver.findElement(By.xpath("(//div[@class='selectItemText'])[2]")); Thread.sleep(5000); element.click(); Thread.sleep(10000); driver.findElement(By.xpath("(//nobr[text( )='MDialog'])[4]")).click(); //driver.findElement(By.xpath("//nobr[text()='MDialog']")).click(); ...


0

First of all Select is not working with Div or any other element. Select are use only with element is having Select tag and inside it, only having option tags. Solution : WebElement element=driver.findElement(By.xpath("//div[contains(@id,'isc_FX')]")); element.click(); driver.findElement(By.xpath("//*[text()='MDialog']")).click(); Try this. ...


1

Javascript support for webdriver is pretty rough, so here's an example of this in Javascript, in case you're like me and need to go spend another half hour digging through documentation to find the right method names in JS: let profile = new firefox.Profile(); profile.setPreference('network.automatic-ntlm-auth.trusted-uris', '.company.com') let options = ...


2

This shows how. "TestNG is used to enable parallel execution on runner level"


0

The button that's not working is missing the closing dash in the span tag - is that a copy and paste issue, or have you lifted it straight from your script? For example: <-span class="icon-disk gb-icon gb-search-icon" title="Save view" ng-click="showSaveFilterModal()"><-/span> versus: <-span class="icon-disk gb-icon gb-search-icon" title="Save ...


0

I would try selecting the element and dump its text instead of clicking it, to see if it's a matter of selection or event activation. Two other possible problems could be: a race condition where this DOM is not rendered yet when you select (although usually there are implicit waits preventing this in place) the element not being displayed, as WebDriver ...


0

Here is an example from the tests of the project of how to use this method: public function testElementsKnowTheirTagName() { $this->url('html/test_element_selection.html'); $element = $this->byClassName('theDivClass'); $this->assertEquals('div', $element->name()); }


1

Selenium does not have the capability to automate the desktop applications.It cannot recognize the objects in a desktop application. Selenium drives the testing using the driver object that identifies the elements on screen using id, cssselector, xpath etc. which are not present in a desktop app. Though there is ID behind the elements in a desktop app but as ...


0

I'll share my case: I had this issue with my Django selenium tests (django==1.7.12 and selenium==2.53.1) with ChromeDriver 2.21.371459 and Google Chrome 48.0.2564.116. I was able to isolate the issue. In my case it was happening only for pages referencing a static file (an image in a HTML tag for instance http://cdn.local.myproject.net/static/myimage.png) ...


4

Yes and you're definitely ahead of the crowd already with the plan you've laid out. Additional considerations: In addition to using a Page Object Model, consider a central place for hard coded values (simple methods that return a string in some cases). So the identifiers for the css locator for last_name are in one place (along with other css element ...



Top 50 recent answers are included