w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » SELENIUM » Page 1
How to manage different test cases with Feature file in Specflow
You could create a feature file and have your various stories as scenarios. If a story can be broken down into various tests, you could have a feature file per story. It depends on your context and the level of abstraction and detail you are trying to achieve with your tests. I usually try to have very focused feature files that concentrate on testing one concepts. If I end up with too many scena

Categories : Selenium

certificate import selenium webdriver
Create a new Firefox profile, import all your certificate in that profile and then use that profile while instantiating Firefox webdriver instance. To create new Firefox profile refer this link. Once you import your certificate to newly created profile, use below code to create Firefox webdriver instance: ProfilesIni profile = new ProfilesIni(); FirefoxProfile profile = profile.getProfile("your

Categories : Selenium

Selenium WebDriver - Have a button with two click zones and selenium is not clicking properly
You need to click open the window and wait for that to open.So, Some wait needed after your first click Then, You probably have to use switchTo() to set focus on the newly opened dropdown window. Some examples how to use it are here. After that use a textbase search for finding your element. Something like this. EDIT: I found text base search helps a lot in such cases. try this: driver.findEleme

Categories : Selenium

Selenium get http response headers or access the browsers's download history
Selenium can't actually do this (capture network traffic). I would suggest using a third party tool like Browser Mob I don't know if you can get your browser's download history... but as a workaround you can just download files to an empty directory, and just call that your download history. You could also rank files by time downloaded using os.path.getmtime import os from selenium import webdr

Categories : Selenium

Selenium and Zurb Foundation Issue
Couple of things you might want to take a further look at. This SO post indicates a similar issue with HTMLUnitDriver. Check if you are initializing the driver with javascript enabled HtmlUnitDriver driver = new HtmlUnitDriver(); driver.setJavascriptEnabled(true); The other thing to note is instead of trying to get the innerHTML attribute, execute the javascript code mentioned in the post. Don'

Categories : Selenium

Selenium WebDriver findElement
Assuming you are using java, this code might work out for you:- driver.findElement(By.xpath("//input[contains(@class, 'az-btn') and @value='kerko']")).click(); OR, Simply use the attribute 'value'. driver.findElement(By.xpath("//input[@value='kerko']")).click();

Categories : Selenium

How to parse extJS using Jsoup?
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class Main { public static void main(String[] args) throws Exception { WebDriver driver = new FirefoxDriver(); driver.get("http://dev.sencha.com/extjs/5.0.0/examples/desktop/index.html"); WebElement not

Categories : Selenium

Selenium/Watir can't detect Chromedriver, even though it's in my path (Windows 7)
I found real nice posts here and here. You can configure in super easy steps. I have tried and tested working superb. From post 1: Change from firefox to chrome (wherever you have instantiated the browser ), so that it will become: @browser = Watir::Browser.new :chrome Now if you are on Windows, copy paste the downloaded binary file in C:/Windows directory` Second post tells about how to chang

Categories : Selenium

Double click for selenium chromedriver is acting as a single click.
I had same issue and I was able to find that second perform() fixes the issue elem = self.wd.find_element_by_xpath(xpath) actions = ActionChains(self.wd) actions.double_click(elem).perform() actions.perform()

Categories : Selenium

Can't access javascript text via css selector
Not familiar with the framework you mentioned but it is possible that $(".sample").text() returns an empty string because the code within the <script> tag is not a visible piece of HTML. As mentioned in this SO post try using either $(".sample").html(). This of course is assuming that the gebish framework API supports a .html() method on the object. You could find something equivalent in th

Categories : Selenium

TestNG index.html file when clicked opens the html source code
Assuming you are using Eclipse IDE, this happens because the IDE opens it in the default Editor, i.e, the HTML Editor. Try this: Right click on the "index.html" file -> Open With -> Web Browser This will open the file in the WebBrowser provided by Eclipse IDE. or Right click on the "index.html" file -> Open With -> System Editor This will open the file in the default browser of your syste

Categories : Selenium

Automating the search results with all the items in the result with specific color
your only option, if the search results do not provide the information needed, is to further query to get that information. You tagged this specflow so having your steps would be useful, but assuming that you steps look something like this: When i enter "blue" and search Then all the items/clothes in the results are blue you can then implement your then step something like this (pseudo code):

Categories : Selenium

Element is not clickable when another element covers it
I have no suggestion how to click the element as long as the massage is displayed but you could skip waiting for it to disappear by removing it on your own using javascript and webDriver.executeScript: How to make a DIV visible and invisible with JavaScript

Categories : Selenium

Focus issue with client side validations
Try below code: session.click("id=name"); session.sendKeys("id=name",""); session.click("id=email"); //wait for 3 seconds; if this works, you can use dynamic wait here Thread.sleep(3000); verifyTrue(session.isVisible("css=div.field-error.errorname")); And you are using Selenium RC API, not Webdriver API, better to use Webdriver API.

Categories : Selenium

Find out correct xpath
This will click on the Meat-BBB's img: driver.findElement(By.xpath("//div[.='Meat']/following-sibling::*[2]//img")).click(); It finds the 2nd sibling to the div element having text/innerHtml as "Meat", and then traverses to the first "img" element in it.

Categories : Selenium

Not able to attach image using Webdriver
Assuming Image has the path to the file you want to upload, say "D:\Image1.png", try this: WebElement img = Driver.findElement(By.xpath(".//*[@id='ctl00_PlaceHolderMain_ITSNewIssue_file_upload']")); img.sendKeys(Image); Note:- No need to do img.click(); because, it will then open a window dialog box, which can't be handled by Selenium directly, and you will have to use Sikuli/Autoit for that.

Categories : Selenium

Selenium iedriver IE 11 not starting
Never mind, the parameters I set for the IoC were wrong. There seems to be no constructor with url, browser AND capabilities. The correct conf part is : <component name="IE" type="Baseclass.Contrib.SpecFlow.Selenium.NUnit.RemoteWebDriver, Baseclass.Contrib.SpecFlow.Selenium.NUnit.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-de

Categories : Selenium

Getting element with htmlunit driver doesn't work
Are you sure that the parent is a div element with the css classes viewer and bg-black30 ? You should use css selectors instead, that’s much easier. In your case it would be By.cssSelector("div.viewer.bg-black30 img") Take a look at the 30 css selectors you must memorize

Categories : Selenium

Selenium ide change values at runtime
instead of "store" you should use "storeEval", and leave field "value" empty try <tr> <td>storeEval</td> <td>storedVars['CallTime']=${ElapsedTime}</td> <td></td> </tr>

Categories : Selenium

webdriver (c#) - Assert text from a specific UL tagname
You can either directly find that element using an XPath selector that matches on text (example selector below, not tested): //td[contains(@class, 'def')]//ul/li[text()='4 -- test four')] (find me a td that contains a class of def, get the ul underneath it, and get the li underneath that which also has a text of 4 -- test four) You can also harness the power of LINQ in C# to do some leg work f

Categories : Selenium

How to check if a checkbox is enabled or not?
Use the following code. This will return a boolean value based on if check box is checked or not. Based on that you can either click on the checkbox. Happy coding. boolean selected = element.isSelected(); if(!selected) { element.click(); }

Categories : Selenium

How to set value of text field all at once with a webdriver?
You could directly set the value of the field using execute_script. Given a page with a textarea: <html> <body> <textarea></textarea> </body> </html> Inputting the textarea with set took 6-9 seconds (with Firefox/Chrome): input = 'a' * 4000 browser.textarea.set(input) However, by using execute_script to directly set the value, it only took 0.2 sec

Categories : Selenium

Genymotion emulator with selenium
I got the answer and integrated successfully Genymotion with selenium. I have done following : 1 - Install genymotion plugin in eclipse 2 - Configure Selendroid JAR file with my project 3 - Specify Genymotion device serial in my program like capa.setSerial("192.168.xx.xxx:xxxx"); 4 - Thats it , I able to run genymotion through selenium now.

Categories : Selenium

Cloud9 Watir/Selenium Testing
First an explanation. I found it very easy to set up github, c9.io, and codeship for CI and CD using Cucumber for acceptance testing on Codeship. Unfortunately, developing the Cucumber tests was difficult, because I had to commit, push, and examin the failing Integration tests on codeship. I wanted to be able to quickly run and debug Cucumber scenarios in the IDE. But, there is no browser for wati

Categories : Selenium

FluentAutomation + scriptcs not working
I ran into a similar issue. You may need to install ChromeDriver (http://goo.gl/yH3jNq) Be sure to setup the location of the driver .exe in your PATH

Categories : Selenium

What is the correct Selenium syntax to assert that I'm unable to view a particular link/element?
You can switch to $driver.find_elements that will return an array without raising an exception. Then you can check for the size of the array to make sure it is empty indicating that the element was not found.

Categories : Selenium

Is there an elegant way to ask the hub the max no of browser instances a node registered with it can run?
So I found the possible answers. The answers to this one are - Write your own servlet by pulling the selenium server code. Scrape through the grid console and look for chrome.png matches. I have done the 2nd and it is working fine.

Categories : Selenium

unable to identify tooltip message present for the textboxes in selenium
Looks like developer needs to be consulted for this. In javascript it seems like the signin button will remain disabled until both values are filled i.e. username and password. I am not much into javascript, may be you can consult the developer in order to understand this more. You can refer image below:

Categories : Selenium

Click div on Selenium doesnt fire the event. What else can I try?
I ended up trying the click on many different places and found one that it works fine. For example, if I have: I tried first clicking on the element Then on each until one worked, even if that particular div didn't have the event wired to it.

Categories : Selenium

Selenium WebDriver how to select a random option from select option menu excluding one option
add couple of lines of code to define a range Random randomOption = new Random(); int startOption = 1; //assuming "--your choice--" is index "0" int endOption = user_country.getOptions().size()); // end of range int number = startOption + randomOption .nextInt( endOption - startOption); //then do your stuff Select kraj = new Select (driver.findElement(By.id("kraj"))); kraj.selectBy

Categories : Selenium

How can I use seleium test case in groovy?
Groovy is essentially Java underneath. So a GroovyTest case you would structure exactly like a JUnit3 test. class SampleTest extends GroovyTestCase { void test_FirstTest() { WebDriver driver = new FirefoxDriver() driver.get(some url) ..... } } If you like, you can have a look at several sample tests that I have written in Groovy, here.

Categories : Selenium

Taking screenshots with Selenium Builder
So I pulled down and looked at the source for Selenium Builder 2 and found two files that I think show the origin of the error, command_processor.js and driver_component.js. I can't make out why the error is occurring - maybe someone here can build on this?

Categories : Selenium

Click on the link by class attribute as XPath
I didn't work with this API, but I used a similar API. You can get a specified element in 3 different ways: Using XPath Using CSS Using some HTML attributes ( E.g.: id, name, class ) or tag names In JavaScript you have some similar methods ( E.g.: getElementById, getElementsByTagName ). So, you are in the 3rd case. This is a different situation, not a short form of XPath.

Categories : Selenium

JavaScript Error: e is null popup during Selenium Test
Could be an issue with the driver itself. Have you looked at these issues logged with selenium webdriver? Issue 7977: Upredictable javascript errors "e is null" Issue 8095: fxdriver.error.toJSON fails to match qualified method names containing $ Based on the rev logs these fixes seemed to have been added after 2.44.0 release so they may not have made it yet to a release version.

Categories : Selenium

Getting Stale Element Reference Exception while trying to menu links in a web page
If you click on a link and you are taken to the different page or even if you stay in same page the DOM is refreshed. Those elements are not attached to DOM anymore. You need to write some code to come back to previous page if your click takes you to a different page or even if you stays in same page you have find the link on the fly to click instead of "e.click()"

Categories : Selenium

Selenium 2 chrome driver fails with WebException inside HttpCommandExecutor
Launching chrome with 'no-sandbox' resolved the issue. Here is how the final configuration looks like : var options = new ChromeOptions(); options.AddArgument("ignore-certificate-errors"); options.AddArgument("no-sandbox"); var driverService = ChromeDriverService.CreateDefaultService(); driverService.EnableVerboseLogging = (ChromeDriverVerboseLogigng == "true"); driverService.LogPath = Ch

Categories : Selenium

how to locate an element to perform a click
The map is in an iframe, you're probably not telling Selenium to look in there. I would also look for the span tag, and since the id listtoggle is used many times (poor design, making it worthless), just look for contains Startups. // Also should probably use a wait here, in case the page takes too long to load chromeDriver.switchTo().frame(chromeDriver.findElement(By.tagName("iframe"))); WebE

Categories : Selenium

Build won't fail in Travis-CI, even though Selenium test fails
after_deploy currently doesn't fail the build in Travis CI. If you want to test your application against a running staging system on Heroku, then I'd recommend deploying this manually as part of the before_script step and then running the ./gradlew seleniumXvfb command in your script section. That way you can then do a proper production deployment based on the success of testing against your sta

Categories : Selenium

how to select the value from "Span Type dropdown" in Selenium webdriver
You can use the following function to select values from your drop-down The below function will select 0 value from the drop-down, you can parameterize the following line (temp.equals("0") and pass the value which you want to select List<WebElement> element = driver.findElements(By.cssSelector(".txt_black.heading_4")); for (int i = 0; i < element.size(); i++) { String temp

Categories : Selenium




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.