find_index saves some extra overhead:
b.divs(class: 'grid').find_index { |div| div.text == 'text6' }
On Mon, Jul 18, 2016 at 7:21 PM, 'John Fitisoff' via Watir General <
watir-general@googlegroups.com> wrote:
> probably nicer ways are doing it but think this'll work
>
> index = nil
>
The pattern that I'm assuming Soori is asking about is one I often use for
lists. Say I have a list of addresses and I want to delete one.
I'll do something like this:
def delete_address(address)
index = browser.div(id: "address_section").divs(class:
"address_item").find_index do |div|
I believe this should work.
div(:index => 4).text
Joe
On Jul 18, 2016 5:05 PM, "Soori" wrote:
> I have a scenario where there is a grid of elements with same class name.
> I need to identify the element position using index.
>
> For example:
>
>
>
> text1
> text3
> text4
On Monday, July 18, 2016 at 2:05:06 PM UTC-7, Soori wrote:
>
> I have a scenario where there is a grid of elements with same class name.
> I need to identify the element position using index.
>
> For example:
>
>
>
> text1
> text3
> text4
> text23
> text6
> text88
> text3
>
>
>
>
> in the
On Monday, July 11, 2016 at 8:31:30 AM UTC-7, Ajay Reddy wrote:
>
> Hi All,
>
> I am getting this "cannot load such file — Config/Data/data_form.yml
> (LoadError)", I need your help to fix this issuse.
>
>
> require "./TestData"
> require 'yaml'class CardSubmission < Application
> include
On Friday, June 10, 2016 at 9:51:07 AM UTC-7, sivam wrote:
>
> How to set native events false on IE using watir. This could be one of the
> reason.
> On Jun 9, 2016 4:13 PM, "Mathusudhanan R" wrote:
>
> I tried placing first line "click event" on do while loop with some
>
On Sunday, July 17, 2016 at 5:40:42 PM UTC-7, Ajay Reddy wrote:
>
> Hi All,
> I am generating excel report.
>
> Here is my code:
> module WriteReport
> require 'spreadsheet'
> require 'rubyXL'
> require 'time'
>
> def self.get_blank_row
> workbook = RubyXL::Parser.parse($result_xl)
>
Thanks johnssn, it worked.
Cheers,
S
On Monday, 18 July 2016 17:21:47 UTC-7, johnssn wrote:
>
> probably nicer ways are doing it but think this'll work
>
> index = nil
> b.divs(:class, 'grid').each_with_index do |div, idx|
> index = idx if div.text =~ /text6/
> break if index
> end
>
>
>
On Monday, July 18, 2016 at 2:05:06 PM UTC-7, Soori wrote:
>
> I have a scenario where there is a grid of elements with same class name.
> I need to identify the element position using index.
>
> For example:
>
>
>
> text1
> text3
> text4
> text23
> text6
> text88
> text3
>
>
>
>
> in the
On Tuesday, July 12, 2016 at 2:29:28 PM UTC-7, Ajay Reddy wrote:
>
> Hi All,
>
> Can any one help me with this issue.
>
>
>
>
>
> Thank You,
> Ajay.
>
>> Can any one help me with this issue.
as asked?
No. Nobody here can help you as it is unclear what your issue is beyond
the title.
10 matches
Mail list logo