How to enter text into user name when user name text field is on different frame using Webdirver - selenium

I have to login to application. But username and password text boxes available on different frame on the UI.
When i record using the IDE and exported into JAVA then same code is not working.
I am getting an error saying element is not present. This because the text box is on additional frame on the UI.
Kindly let me how to get the control of this frame and then enter the text.
Thanks,
Md Ashfaq

are you recording via ide on firefox and then running your tests on some other browser?coz sometimes diff browsers interpret it differently[I have faced issues where same webpage had iframes in firefox but not in IE].kindly check on that front.

Use The API capability to SwitchToFrame() then Look for element and interact with.
Note: You'll have to switch to any frame needed i find it efficient doing a selectDefaultFrame, try Iterating within Available frames and get handle/frame names

Related

How to handle Micro Popup in Webdriver.io browser

When starting a website, I find it difficult to click Block button on Microphone popup because I can't query this popup (and also with block btn)
How can I handle this problem with Webdriver.io in browser?
enter image description here
One option is to use chrome command line switches. You can find the list here.
The one you are looking for is use-fake-device-for-media-stream. You can set this in your config file so that every time the chrome is launched, it won't show this popup since it is already set to a fake device.

extracting html element Id or xpath using computer vision

I am working on automating an inhouse automation testing software for my firm, I need to extract the X-path, or id of an HTML element when the tester clicks the webpage element like the login button during the manual testing process, need to extract data like element id or x-path, and what type of action he is performing like click, enter or filling the text box, etc. these data would be useful for integrating with my existing selenium script and perform automation testing, currently exploring feasibilities of computer vision. Kindly suggest some ideas to make it possible.
-I think you need to extract and read HTML of the page separately then perform any concept/Algorithm of computer vision to detect all elements of the page including text , buttons and drop down list....

Drop Down Form for Date is Deformed

I use sharepoint 2010 and I get a deformed pop up menu for Date selection. Nothing fancy here. Just a simple form to enter some data with date.
Have you seen this before? I get the same effect in Chrome/Firefox latest versions.
Thank you in advance
This is a problem with your SharePoint site's CSS (or possibly with JavaScript that affects the CSS).
That big image is a spritesheet; CSS is supposed to crop the visible region so that you only see the specific sprites that are relevant to the current control.
You can pull up the developer tools with F12 and inspect the image element and its containers to see what CSS is currently applied, as well as check for any errors in the JavaScript console.
Clear your browsers cache and reload page. Delete the datetime column and create a new.

Sikuli integration with Selenium WebDriver

Can anyone tell me how to work with multiple edit boxes using Sikuli integrated Selenium WebDriver.
For example, I have 2 edit boxes which are labeled as username and password. So I want to click on the 1st edit box, then enter values and again want to click on the 2nd edit box. The size of the two edit boxes are the same. So how sikuli integrated Selenium WebDriver will identify which edit box to click.
If you are referring to the SikuliWebDriver, then this link has an example on the usage http://code.google.com/p/sikuli-api/wiki/SikuliWebDriver.
I would rather prefer using the Sikuli Java API and create wrapper functions around the Sikuli functions like click, type etc. This API is in active development and has good support available.
http://doc.sikuli.org/faq/030-java-dev.html
You can use the offset functionality. ie, you do not only use an image of the text field, but use a region of the screen which identifies something related to the text fields.
You may select a large rectangle which includes a heading above both fields, then use offset x/y coordinates and move the little crosshair over the exact location you wish to click/type.

Selenium Webdriver 2.30 unable to identify object on the standard Salesforce lookup pop-up window

I am using Selenium Webdriver to automate functional TC in Salesforce application.
Test Scenario:
- On a case page, clicking the "Lookup" i.e., search icon opens up standard Salesforce search popup. I need to input specific string to the search field and click "Go" button.
Although I am able to click on the Search button, the script fails to identify any field on the popup.
I used Alert(), getWindowHandle & iterator functions to verify if the driver is working on the popup window. Yes it is.. the popup is is the working window. I could able to confirm this using the Java id for the browser window. But still it fails to identify any fields.
Let me know if any of you faces similar issue and any solution.
Do let me know if you like to have access to my working sandbox. Would be able to manage it.
Thanks, Manju
I believe the problem is that the elements inside the popup window are in a frame. After switching to the new popup window you need to switch to the frame first before being able to access any of those elements using:
WebElement frameLocator = driver.findElement(By.id("searchFrame"));
driver.switchTo.frame(frameLocator);
Further to Bob's answer you'll also then need to switch to the "resultsFrame" in order to use any of the links returned by the search. Note that in order to switch to a sibling frame you must first go up to the parent of the frameset using:
driver.switchTo().defaultContent();
(frameset guidance here: http://darrellgrainger.blogspot.co.uk/2012/04/frames-and-webdriver.html)
With Selenium IDE:
I was able to select the Salesforce PopUP with this code:
Command:selectPopUp
Target:
Value: Your popUp title
And the result frame:
Command:selectFrame
Target: name=resultFrame
Value: