Erica
Erica

Reputation: 1

how to click on text area to send long text using ruby with selenium web driver

I tried xpath and id getting `until': timed out after 10 seconds (no such element (Selenium::WebDriver::Error::TimeOutError) I am using rubymine editor.

wait = Selenium::WebDriver::Wait.new(:timeout => 10)
wait.until { @driver.find_element(:xpath => "//*[@id='j_id0:pb:j_id35']") }
@driver.find_element(:xpath => "//*[@id='j_id0:pb:j_id35']").send_keys "test send sms"

Text area element is placed on bottom of the page.Do I need to scroll down the page and click and sendkeys in the text area. in the below code I am trying to find nearest element to the text box and do scroll down later click on text area and sendkeys.But even it's not working..

 #wait = Selenium::WebDriver::Wait.new(:timeout => 10)
#wait.until { @driver.find_element(:name => "j_id0:pb:j_id33") }
#scroll = @driver.find_element(:name => "j_id0:pb:j_id33")
#scroll.location_once_scrolled_into_view

Please help on this.. Thanks!!

Upvotes: 0

Views: 602

Answers (2)

Erica
Erica

Reputation: 1

Thanks Shukla!@sourabh shukla Mine inside has frame so I need to switch to frame that is why I am not able ciclk that element!! @driver.switch_to.frame("06618000000Crrp"#this is id); Then my element found and entered text!!

Upvotes: 0

Ninja java
Ninja java

Reputation: 105

I don't have idea on rudy but can help you logically..

1) first scroll the page from your code to the text area.

2) select the text area by id, xpath or etc. driver.findelement(by.id(...)).sendkey(..........);

Upvotes: 1

Related Questions