Tag Info

New answers tagged

0

Hi I am facing similar problem but for me @id is dynamic :- //div[@id='SubmissionWizard:LOBWizardStepGroup:LineWizardStepSet:WC7LineCoverageScreen:WC7LineCoverageCV:WC7ConditionsDV:5:CoverageInputSet:ConditionInputGroup:PolicyOwnerOfficerLV-body']//tr[RowIndex]//td[ColIndex+5]/div[@class='x-grid-cell-inner '] In the above @id is ...


1

I believe that you should uncheck "Install Maintenance Service" box during Firefox installation, in that case you should be protected from automatic updates. Also avoid opening "About Firefox" window as Firefox is known to update itself when you open it. In regards to what version of Firefox is supported, as per Using Selenium with JMeter's WebDriver ...


0

To simulate complex (mouse) actions rather than working on the elements directly, use ActionBuilder. See the reply in this thread for a starting point.


0

Please check if this link helps. It links to various posts on how to handle modal dialogs with selenium webDriver.


0

From the code it looks that you are not initializing the WebDriver correctly. You declared a private member of WebDriver and never used it. In your SetUp method do the following change. public void setUp(){ System.setProperty("webdriver.chrome.driver", "/Applications/chromedriver"); driver = new ChromeDriver(); ...


0

.properties files in Java use always ISO-8859-1. You are not able to save UTF-8 characters into .properties files. You must save the characters as unicode escape characters. In your example the value of the key must look like this: Seulement Alphabets, des chiffres et des espaces sont autoris\u00E9s Take a look here: ...


1

The logical guess would be checking the element property: bool isDisplayed = driver.findElement(By.XPath("//span[text()='Show']").isDisplayed; Should this not work (because you're using the CSS width instead of CSS display), try: String s = driver.findElement(By.XPath("//span[text()='Show']").getAttribute("style"); if(s.Contains("100%")) { // the show ...


0

public static void WaitForData (IWebDriver driver) { var dt1 = DateTime.Now; var diff = 0; while (diff < 3) { var dt2 = DateTime.Now; var ts = dt2.Subtract(dt1); diff = (int) ts.TotalSeconds; } }


0

For a quick and dirty method that will be fragile and perform poorly, but will allow you to get your test working, open the page in Firefox, open the development tools, find the element in the source viewer, right click, and there should be an option to create an XPath query. Just noticed the "contains" in the question, if that's important then ignore ...


0

I am not sure if i know how you got your error. But i have faced this error lot of times and to me looks like its the same. I don't have enough reputation to comment and ask but still would like to answer it. Problem in your code: You are trying to inherit from unittest which is a MODULE and not a CLASS. For example : >>> import unittest ...


0

Sure it's a low level question, but based on how I understand the question this would be my suggestion. I was a beginner once too and I remember how frustrating it can be. # make a list for everything you want to loop over browsers = [ 'chrome' ,'firefox' ] client_urls = [ 'www.client1.com' ,'www.client2.com' ] sub_pages = [ ...


1

I was able to answer my own question, Please see script below: urlTextBox = "url" dropdownOption = "location" submitBtn = ".//*[@id='start_test-container']/p/input" homeBtn = ".//*[@id='nav']/li[1]/a" webTeamPage = "personalwebpage.com" select = driver.find_element_by_id(dropdownOption) #get the ...


1

I have the same issue and have yet to find an answer. As a workaround you can use a loop and: searchBox.SendKeys(Keys.Backspace);


0

First of all, you don't want the xpath to do a lot of works. So, be little bit more considerate when you the write xpath You don't need to walk down the whole hierarchy to find the element with xpath. Relative xpath would be enough for selenium. Read this //tbody//td[contains(text(),'1-2-3')]


0

As far as I understand you are talking about pageLoadTimeout Which sets the amount of time to wait for a page load to complete before throwing an error. If the timeout is negative, page loads can be indefinite. Basically page is considered as loaded when this statement (javascript) evaluates as true document.readyState === 'complete' posible results for ...


2

Basically you can use explicit wait to wait until your specific element of page get visible. There are 2 types of wait : 1 - Implicit wait 2 - Explicit wait Examples are given below : Implicit wait Syntax : driver.manage().timeouts().implicitlyWait(time period, TimeUnit.SECONDS); Explicit wait Syntax : WebDriverWait wait = new ...


0

If you can List down the error you are facing, it would be good help and we can guide you better. Moreover, its better not to use xpath locators. I am pretty sure every field would have an 'id' or 'name' and using that would be a better approach. The dialogue box that opens up when you hit the 'Add Name' button might have an iframe and you should first ...


0

Let's take a look at your xpath selector: //div[4]/ul/li[2]/a This says that you want to find the fourth div on the page, under which there's a list. Then pick the second item in the list's first hyperlink. This is incredibly brittle; if selecting a time slot adds another div to the page, say, one indicating that the slot isn't free, suddenly the xpath ...


2

It depends on the definition of "Unit Test". The definition is very clear, yet there is still a large number of people who call things that really aren't Unit Tests "Unit Tests". Real Unit Tests test small units of code, usually a single class consisting of up to 200 lines of code. If a developer writes a new class by first writing Unit Tests, they put a ...


5

A perspective from a developer: A unit test is best written in conjunction with the code it's testing. It will shape the code to some extent: the need to write a test forces the code to be easily testable, which limits some code smells/anti-patterns. For example, a method that directly calls the database to obtain a user name will be hard to unit test until ...


1

Without the Select class Everything I listed in my other answer can, of course, be done with judicious use of selectors. Since the Select class doesn't exist in Ruby (to the best of my knowledge), this is the only way to work with Select options in Ruby. Again, the HTML: <select id="mySelectID"> <option value="Value">Option</option> ...


2

Using the Select Utility Class The big secret to working with dropdowns is that you don't want to work with them as WebElements, but instead create a Select element for them. The Select class (java and python documentation) includes utility methods that allow you to perform common tasks. We will be working with the following html: <select ...


1

Is it difficult? This greatly depends on your development skills, but as unit-tests are often derived from from a TDD cycle I would think creating tests after the work is done is very hard. Its better to first write the tests first and then the code. I would suggest you start reading the book "Test Driven" (it uses Java), this will make you understand ...


1

Mostly we have heard and read that whitebox testing can be done by Developer not Tester. It is because developer have more and depth coding knowledge. But If you are having really good experience with coding and specific knowledge of programming language in which site/software build , then you can do whitebox testing. Also about your second question it is ...


10

Writing unit tests is not difficult - as the saying goes, it is matter of simple programming :-) So if you are competent programmer, and are willing to learn necessary skills and patterns, you can do it as QA engineer. But IMHO (and best practices say that) developers are much better suited to write unit test - because unit tests use internal calls to ...


0

There is two problems 1. Looks like your search option is wrong. So better to use xpath for that. 2. You can just sendkeys to dropdown like in exapmle below client.findElement({ xpath: '//*[@id="form-tab-1"]/div/div[1]/select' }).sendKeys(Mr.);



Top 50 recent answers are included