New answers tagged

0

@santhosh - I have already shared answer, here. It might resolve your problem. Hope it helps!


0

You're not focused in the right window. With this case you want to use: driver.SwitchTo().Window(driver.WindowHandles.Last()); Last() will switch to the most recently opened window which should be the one you just clicked.


0

Yes, your app is designed in a way it is really hard to test by a E2E script. Let's hope you started by having plenty of unit tests. Use page object to provide services to your test. Then, start with creating few "happy path" tests exercising most commonly used functionality. When done, start adding functionality which interrogates page object in which ...


0

Preparation and planning is the key. "If I had eight hours to chop down a tree, I'd spend the first six of them sharpening my axe." Try to create a quick map/sketch of the workflow Define small methods/actions/steps that are reusable (in this case at least 12 steps) In your defined methods use switch to decide when to change actions/data used For every ...


0

You can use any of the below mentioned way to select that particular element. driver.FindElement(By.Xpath("//input[@title='Name Required Field']")).sendKeys("Newprojecttest"); OR driver.FindElement(By.Xpath("//input[starts-with(@Id,'FileLeafRef')]")).sendKeys("Newprojecttest"); Hope it helps!


0

I recommend using a CSS selector, yours would look something like: var element = driver.FindElement(By.CssSelector("input.ms-long")); element.SendKeys("Newprojecttest"); Hope this helps


0

You can try different selectors based on existing value of attributes that do not change or to use a selector based on a fixed part of the attribute. Here are some css selectors that you can try: input[id*='FileLeafRef'] input[id*='onetidIOFile'] input[title*='Name'] input[title='Name Required Field']


0

in some times you will face this type of problems to find the elements,at that time you can try different methods,mostly it will work for driver.findelement(By.name("xxxx")).click(); By.name will work most of the times,same i have faced and resolved with these name locator. Please accept this answer in case it is resolved your problem.


0

I imagine your application to be somewhat analogous to an auto-insurance website. Page 1: Fill personal info Page 2: Fill vehicle info Page 3: Fill previous insurance history Page 4: Choose insurance type Page 5: See Quote There are validations to be performed in each page but you cannot move onto 'Page 2' without filling 'Page 1'. The approach you ...


1

That was what I had previously believed also (because I've done dev) until my current position whereas the director is my source for this who actually sees the numbers. Although, maybe its more specialialist thing. You generally don't become wealthy as anyone's employee.


4

Test automation is not high-end coding. You will not become wealthy doing either test automation or unit testing. Typically, unit-testing is not a separate job title. Experience with unit testing is more likely to lead to a career as a developer than Selenium automation. You are likely to make more money as a developer than as a tester.


1

I seeing that this is C#, so not sure if this would work. But you can use a new variable, whose type is WebElement, something like this WebElement ele = webdriver.FindElement(By.Xpath('Xpath_that_you_have')); Please note that you need to replace Xpath_that_you_have with the actual xpath that you have mentioned. then, use this ele element and find the ...


2

I would have 4 types of tests: unauthenticated functionality authentication ('login') tests for happy and sad paths tests for content for user type 1 (admin?) tests for content for user type 2 (standard user?) I don't know your framework but those are the high level groups. Within each of those I would have detailed tests for specific functionality and ...


0

No, there is not any option or trick to upload a file using the windows file upload dialog when executing tests remotely.


0

@kehinde - Below are few snippets to SKIP test Solution 1 Add snippet in pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> <configuration> <skipTests>true</skipTests> </configuration> &...


-1

//define method public void WaitFindAndClick(IWebDriver parent, By by, int counter) { bool Displayed = false; for (int v = 0; v < counter; counter++) { try { Thread.Sleep(2000); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); ...


2

In many cases slenium does not get the element eventhough it is present. script works some times and fails as well. This code works when actaul element is present but selenium is not find it. I have create a loop for given count ant it returns true. public static bool waitTillElementisDisplayed(IWebDriver driver, By by, int timeoutInSeconds) { ...



Top 50 recent answers are included