[wtr-general] Re: How to Trace the change in a field
That doesn't look like HTML to me, it looks like an xpath. Show us the actual HTML for the page, Show me line 12 of your attempt to use the code I suggested, since that is where the error is On Mar 7, 1:26 am, Ashu ashay.n...@gmail.com wrote: Yes, you are right Chunk, My HTML code looks like this - /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/td class=normalChange counter/tdtd class=normaldiv class=system0/div/td/tr I have tried as suggested by you, It gives me following error... C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ jssh_socket.rb:12:in `const_get': wrong number of arguments (2 for 1) (ArgumentError) from C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/ firewatir/jssh_socket.rb:12:in `js_eval' from C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/ firewatir/element.rb:997:in `text' from C:/Documents and Settings/tcsadmin/Desktop/ check_changecounter.rb:9 On Mar 4, 10:23 pm, Chuck van der Linden sqa...@gmail.com wrote: If I read you correctly, the challenge is get the contents of the second cell on the table row where the first cell is 'change counter' is that right? Presuming that change counter appears nowhere else in that table, AND that you have some way to identify the table itself, or a container that holds the table browser.table(:how, what).row(:text, /counter change/).cell(:index, 2).text if there is no other row in any other table that contains 'counter change' then you might even be able to do it by going straight to the row and not worrying about the table element. browser.row(:text, /counter change/).cell(:index, 2).text To understand why that works, do some googling and reading about something called 'regular expressions' PS for challenges like this, a tiny bit more of the HTML such as details on the table, can be useful in terms of people being able to give you better examples of the code you would need to use. The more details you put into a question on the group, the more likely you are to get a more 'exact' answer instead of a generic one. On Mar 3, 10:57 am, Ashu ashay.n...@gmail.com wrote: ya I agree with Orde well my testing page contains multiple tr with same class = normal and div contains class = system for every tr On Mar 3, 10:27 am, orde ohil...@gmail.com wrote: Find a way to determine the value of div class=system and assign it to a variable. On Mar 3, 1:35 am, Ashu ashay.n...@gmail.com wrote: The xpath for the html html trtd class=normalcounter change/tdtd class=normaldiv class=system1/div/td/tr is xpath /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/ td[2]/div On Mar 3, 2:17 pm, Ashu ashay.n...@gmail.com wrote: hi, there is a field on the php page that keeps track of the change in counter field. On every next refresh the value changes of that variable. trtd class=normalChange counter/td td class=normaldiv class=system1/div/td/tr The 1 in the above code determines that one transaction has taken place and it continues to increase up on every transaction update. I am unable to figure out the logic to keep track of the change. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to Trace the change in a field
Yes, you are right Chunk, My HTML code looks like this - /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/td class=normalChange counter/tdtd class=normaldiv class=system0/div/td/tr I have tried as suggested by you, It gives me following error... C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ jssh_socket.rb:12:in `const_get': wrong number of arguments (2 for 1) (ArgumentError) from C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/ firewatir/jssh_socket.rb:12:in `js_eval' from C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/ firewatir/element.rb:997:in `text' from C:/Documents and Settings/tcsadmin/Desktop/ check_changecounter.rb:9 On Mar 4, 10:23 pm, Chuck van der Linden sqa...@gmail.com wrote: If I read you correctly, the challenge is get the contents of the second cell on the table row where the first cell is 'change counter' is that right? Presuming that change counter appears nowhere else in that table, AND that you have some way to identify the table itself, or a container that holds the table browser.table(:how, what).row(:text, /counter change/).cell(:index, 2).text if there is no other row in any other table that contains 'counter change' then you might even be able to do it by going straight to the row and not worrying about the table element. browser.row(:text, /counter change/).cell(:index, 2).text To understand why that works, do some googling and reading about something called 'regular expressions' PS for challenges like this, a tiny bit more of the HTML such as details on the table, can be useful in terms of people being able to give you better examples of the code you would need to use. The more details you put into a question on the group, the more likely you are to get a more 'exact' answer instead of a generic one. On Mar 3, 10:57 am, Ashu ashay.n...@gmail.com wrote: ya I agree with Orde well my testing page contains multiple tr with same class = normal and div contains class = system for every tr On Mar 3, 10:27 am, orde ohil...@gmail.com wrote: Find a way to determine the value of div class=system and assign it to a variable. On Mar 3, 1:35 am, Ashu ashay.n...@gmail.com wrote: The xpath for the html html trtd class=normalcounter change/tdtd class=normaldiv class=system1/div/td/tr is xpath /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/ td[2]/div On Mar 3, 2:17 pm, Ashu ashay.n...@gmail.com wrote: hi, there is a field on the php page that keeps track of the change in counter field. On every next refresh the value changes of that variable. trtd class=normalChange counter/td td class=normaldiv class=system1/div/td/tr The 1 in the above code determines that one transaction has taken place and it continues to increase up on every transaction update. I am unable to figure out the logic to keep track of the change. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to Trace the change in a field
The xpath for the html html trtd class=normalcounter change/tdtd class=normaldiv class=system1/div/td/tr is xpath /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/ td[2]/div On Mar 3, 2:17 pm, Ashu ashay.n...@gmail.com wrote: hi, there is a field on the php page that keeps track of the change in counter field. On every next refresh the value changes of that variable. trtd class=normalChange counter/td td class=normaldiv class=system1/div/td/tr The 1 in the above code determines that one transaction has taken place and it continues to increase up on every transaction update. I am unable to figure out the logic to keep track of the change. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to Trace the change in a field
Find a way to determine the value of div class=system and assign it to a variable. On Mar 3, 1:35 am, Ashu ashay.n...@gmail.com wrote: The xpath for the html html trtd class=normalcounter change/tdtd class=normaldiv class=system1/div/td/tr is xpath /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/ td[2]/div On Mar 3, 2:17 pm, Ashu ashay.n...@gmail.com wrote: hi, there is a field on the php page that keeps track of the change in counter field. On every next refresh the value changes of that variable. trtd class=normalChange counter/td td class=normaldiv class=system1/div/td/tr The 1 in the above code determines that one transaction has taken place and it continues to increase up on every transaction update. I am unable to figure out the logic to keep track of the change. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: How to Trace the change in a field
ya I agree with Orde well my testing page contains multiple tr with same class = normal and div contains class = system for every tr On Mar 3, 10:27 am, orde ohil...@gmail.com wrote: Find a way to determine the value of div class=system and assign it to a variable. On Mar 3, 1:35 am, Ashu ashay.n...@gmail.com wrote: The xpath for the html html trtd class=normalcounter change/tdtd class=normaldiv class=system1/div/td/tr is xpath /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/ td[2]/div On Mar 3, 2:17 pm, Ashu ashay.n...@gmail.com wrote: hi, there is a field on the php page that keeps track of the change in counter field. On every next refresh the value changes of that variable. trtd class=normalChange counter/td td class=normaldiv class=system1/div/td/tr The 1 in the above code determines that one transaction has taken place and it continues to increase up on every transaction update. I am unable to figure out the logic to keep track of the change. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com