how to handle hyperlinked textarea in selenium - selenium

I have a page, where the link is defined with text area. How do I handle this to pass a value to it via selenium?
Here is the UI Code:
<a:TextArea name="Some Name">
I want to click on the link also wants to type the value into it. But with Selenium, I am not able to do that.
Can someone know how to do this?

Nice Question.
How about manipulating the DOM elements with javascript.
As you haven't provided the code so here is the descriptive answer to your question. You need to follow certain steps in order to achieve that.
Find Elements
Disable the link using Javascript, here you can stop its click event
Once you had disabled the click event, you can sendkeys to that field.
Once you done with sendKeys, You can undo the above changes and make click on field.(If You can't undo then just get the href attribute of the <a> tag and store it in any variable and once done with sendkeys, visit that link by passing the variable.
Do let me know if any query occurs.

Related

How to get the xpath of suggested items of google place auto complete field in selenium

I am doing a selenium project. There is a field called address which is a google place auto complete field that suggests palces name like dropdown. Problem with the field is, it cannot be inspected. Whenever i click on inspection button the suggested auto complete list get disappeard?
How can I automate this?

Selenium Find Element by xpath using value as well

I am trying to check to see if buttons are present on a page. The number of buttons varies depending on the type of account that logs in. The code below returns true, so I know that the xpath is working.
Boolean WorkspacePresent = driver2.findElement(By.xpath("//body/div[2]/div[1]/div[1]/form[1]/section[1]/input[1]")).isEnabled();
However, I need to make sure that the value is also included, since this just checks how many buttons are there. If I wanted to check for a "Workspace" button, could I still use Find By Xpath?
To identify the Workspacebutton button use following xpath.Similar way you can identify other button.
driver2.findElement(By.xpath("//input[#name='Workspacebutton' and value='Workspace']"))

How to handle dynamic text with no div tags and no info where they are coming from in Selenium?

I have registration form for which I am trying to create a script.If we don't enter any value in any of the fields and click submit, it is showing a dynamic error message that "Please fill out this field!"
There is no div tag for this text. Moreover, if we click anywhere on the screen, it is disappearing. Can anyone tell, how to read this text?
Thank you.
When the field is marked as required, the Browser shows the message when the form is submitted. There is no way available for you to access it.
You can handle it within your test code by checking that all required fields are entered before submit is called.

clicking button on HTML jscript using vba

I have been trying to click a button on webpage using VBA but with no luck, I could see some JavaScript is used which I am not sure how to use this.
below is the code which I am using also snip of html code is below
ie.document.getelementbytagname(""nobr").click
below is the html code
Insert Row
Please help
KR
Manoj Sahoo
Depending on which element you might need something like
ie.document.getElementsByTagName("nobr")(0).click
Note the s making it plural as it returns a collection of nobr tags. You then access items by index e.g. 0.
Without the URL, or more HTML to go on, it is impossible to tell if you are selecting the right item to click.

Cannot click Submit button on Selenium IDE

I am having trouble getting Selenium IDE to click the Submit button on one of my webforms after having selenium open and fill out the form. I am using the clickAndWait command and identifying the button by its ID:
<td>clickAndWait</td>
<td>id=ctl00_ContentPlaceHolder1_OSVFHResults_btSave</td>
<td></td>
Interestingly, if I write a script that simply opens the form and clicks the submit button without filling it out, I am not having any problems. My problem is coming specifically after I've asked Selenium to fill out the form. Additionally, if I try to manually click the submit button, it doesn't work if the Selenium script to fill out the form was run before my manual input. If I manually open and fill out the form, I have no problems clicking submit, and Selenium works for all of the other form's submit buttons on the site. Anyone have any ideas?
Instead of filling form with type command you can try typeKeys one. It simulates keystroke events on the specified element, as though you typed the value key-by-key and probably enable your submit button.
It sounds like some javascript event unrelated to click() (such as mouseover or onkeydown) is attached to one or more of the form fields and is responsible for enabling the submit button.
You'd have to look at which exact events are being fired, either by looking at the source with something like firebug, or by using a javascript debugger. Then modify your Selenium script to make sure the same events get triggered.
After type the values in the form just try "ClickAtandWait" instead of "clickandWait"..i also face the problem once and it gave hands once..
selenium.clickAtandWait("locator", "position");
if you know the exact "position" just put it, otherwise leave it as an empty string.