Xpath seem to be right when i use chrome but fails on selenium - selenium

I am trying to find the text box in the image below
My xpath using chrome is
div[#id='element.problem.short_description']
div[#class='col-xs-10 col-md-9 col-lg-8 form-field input_controls']
still it fails on selenium.
the code is here on the webpage. I Couldn't copy it for some reason, so attaching a screenshot of it

Because you're not looking at the text field.
All you need is //input[#id='problem.short_description']

Related

Selenium Inspect : 2 divs same footer

I am using Selenium IDE to conduct testing my website.
Please refer to the above image. I have 2 windows one over the other and I need to get the xpath of the 2nd footer that is the last in the image.
When I use Selenium it picks but does not work as expected. In a situation like this how do I know the xpath and which to use in Selenium.
Thanks
You can do this to access the 2nd element with that xpath
driver.find_element(BY.XPATH,"(//div[#class='footer'])[2]")
If you need any of those individual values.
I would use link_text since they all have different text values and are all of a tags.
driver.find_element(BY.LINK_TEXT,"Upload")

How store href from an image xpath selenium ide ui vision katalon recorder

I want to store href url from an image but when i try it show error
This is the code
<img src="//user/banners/16/08/1614708.gif" alt="AAA" data-tip="BBB" currentitem="false" class="" width="468" height="60">
I want to store mysite.com
I already tried storeattribute with xpath and #href but show error (not available work for text link only)
Usually i use ui vision or katalon recorder but i never find a good solution at moment.
I need only xpath
Try this one out to get the parent a tag of the img src.
print(driver.find_element_by_xpath("img[src='//user/banners/16/08/1614708.gif']//parent::a").get_attribute('href'))

geckobrowser set a value in a textarea using c#

Hi i wan set a test of a text area using gecko browser
that is the html of my page
<textarea id="noteField" data-nemo="note-field" class="textArea_gebdo3" style="height: 44px;">texthere</textarea>
as you can see the vaule is not setted in value="text" so i can use usually code for get element and set the vale some idea please ?
This post have a solution in Java with SendKey():
How to set text into TextArea with Selenium Webdriver?
It seems to be close to your problem but it's not the best solution.

Selenium Web driver - No such element error while clicking an element

Script in UI
<div class=navdeactive>Technology</div>
While executing the below script
#driver.find_element(:link_text, "Technology").click
Getting an error>>
Selenium::WebDriver::Error::NoSuchElementError: The element could not
be found
But in view, source link is available.
Web Driver version: selenium-webdriver (2.25.0)
Help me on this
Based on your question you can use xpath and click the particular Html locator.
i have been given below script using python web driver. try this one.
driver.find_element_by_xpath("//a[text()='Technology']").click()
Answer:
In UI text is displayed as TECHNOLOGY But in the Page View Source text is displayed as Technology I have changed the code as #driver.find_element(:link_text, "TECHNOLOGY").click...... Now its worked fine...

Unable to locate dynamic input element with Selenium

I have a textfield in my application , it gets enabled when i click on it. I am able to do click using CSS but i am unable to enter text when it got highlighted.
I tried using xpath to idenfify the dynamicly but webdriver is throwing an error
"Unable to locate element:
{"method":"xpath","selector":"//input[#class='x-form-field
x-form-text']"}![enter image description here][1]
showed the difference before n after clicking on the field in thescreen shot.
Please help in how to dynamically identify and enter the text in that field
try the following:
String cssSelector = "[class='x-form-field x-form-text']"
//but verify found css selector in firepath, firebug addon in ffox to make sure selenium //locate web element for input properly.
driver.findElement(By.cssSelector(cssSelector)).clear();
driver.findElement(By.cssSelector(cssSelector)).sendKeys("blablabla");
Hope this works for you
Try this code:
String cssSelector = ".x-form-field x-form-text"
driver.findElement(By.cssSelector(cssSelector)).clear();
driver.findElement(By.cssSelector(cssSelector)).sendKeys("blablabla");
Let me know is the above scripting is working or not.