[wtr-general] Re: Webdriver cookies domain limitation

2012-06-13 Thread Chuck van der Linden
I think that limitation might come from the browser in terms of cookie 
security, normally one page does not have access to another pages cookies 
 (it gets trickier when there are portions of the page that are loading 
from some other server, such as an adserver, but even then I think only the 
requests made to a specific domain can include cookies for that domain.   
Not sure where we could verify that, might be someone at my prior employer 
I could check with.

Or fire up an http traffic recorder (such as fiddler2 if you are using 
windows) and start looking very carefully at the requests etc.. it may be 
that the other domain is actually the one that is creating that second 
cookie.

One site having access to another sites cookies is generally considered a 
security issue

On Tuesday, June 12, 2012 7:21:26 AM UTC-7, Abe Heward wrote:

 Does anyone know if the limitation of the cookies feature--wherein it only 
 shows you the cookies for the domain of the page you're on--is going to be 
 changed any time soon?

 My use case is:

 Company A has a web page that, when visited, generates a cookie for 
 Company B, because Company A is a client of B, and B will begin serving 
 banner ads for Company A.


-- 
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: webdriver plugin permission information bar

2012-03-30 Thread Chuck van der Linden
I just click the always run' button and ensure that any images used for 
test systems were created after that operation has taken place. 

Or relax the browser security on test systems (not like people are commonly 
surfing to places with malware on those boxen)   If that's an issue for 
your IT folks, talk to them about creating a seperate test domain (or tree 
in your AD) that those systems can be placed in which restricts their 
access to any sensitive assets. 

On Tuesday, March 27, 2012 4:57:02 PM UTC-7, Dan wrote:

 I'm wondering if anyone has a strategy for dealing with the plugin 
 permission information bar in webdriver?  I'm assuming I can simply disable 
 them via profiles with Firefox and Chrome, but that's not an option with 
 IE.  Is there a way to interact with this bar via watir-webdriver or 
 perhaps rautomation?

-- 
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: Webdriver : when i have to grab the id using pattern match it fails for firefox

2011-12-12 Thread Chuck van der Linden
1) answer the question how would a human know where to click or which
field to enter the value in

2) provide a slightly larger sample of HTML than the single element.
The solution to identifying it may rest in text or a label associated
with a container element that wraps both that and the input, so if you
can find the container, then finding the input inside it is often very
simple (it may be the only one, or highly predictable)

3)  read this  http://stackoverflow.com/q/8330926/409820

On Dec 9, 3:17 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote:
 Hi,

 I got the solution,  i written code like this :

 $ie.div(:class = cell-inner overflow-hidden, :text =
 bhavtest).click

 And it works.

 But there are some cases where only thing we can get is id which is
 dynamic like an text filed:

 INPUT class=inputbg id=z_s8_td style=WIDTH: 150px; HEIGHT: 15px
 z.type=zul.widget.Txbox.

 Here it is only dynmaic id and not even any text.

 I see two problems :

 1. How can i enter text in this text field when i just have dynamic id
 usng webdriver?

 2. This particular html is present many times in a page,   so to get
 the ID, which is dynamic, it is very difficult.  Here i cannot use
 class as it is same in many text fields.  If i club index here then it
 is alos risky as many text fileds gets added/removed as applicaiton
 developed.

 So is there any way i can identify this textbox?

 Right now i pattern match it with few lines above this code, i mean
 right now page is like

 Name: Text field,
 passwrod:Text filed

 So i pattern  match with Name: then till this textfield. Grabs the
 id and then enter text in it, like :

 if /TD id=.*Name:.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*
 \n.*\n.*\n.*\n.*\n.*\n.*INPUT class=inputbg id=(\S*) style=.*Txbox/

 But in webdriver this pattern match is not usable, then i have a
 problem, can you suggest any solution to this?

 Bhavesh
 On Dec 9, 2:21 pm, Chuck van der Linden sqa...@gmail.com wrote:







  Lets backup a minute because I think you are going about this in a
  very convoluted way based on something you figured out that works, but
  may in fact be a bit of a kludge.

  The div being clicked on contains a link, an image, and a span with
  text.

  First question, when interfacing with the site, how does a HUMAN know
  what to click on?  Is it the image being displayed?  The text?  the
  combination of the two?  or either?

  If it's the text, then why not just select the div that way

    b.div(:text = 'bhavtest').click

   If it's the Image, then why not find that using a regex for the src
  of the image, and then use .parent to locate the containing div and
  click it?

     b.img(:src = /your_regex_here/).parent.click

  if it needs to be a parameter then replace the constants above with a
  variable, or a regex object created from a variable

  If it's the combination of the two things (image and text) then you
  might have to be a bit trickier but it should still be possible and a
  bit more straightforward than what you were doing.

  Using ID's to identify something is great where that is something you
  can predict, but otherwise, if you are using some other means to find
  the thing you want, doing that in order to get the ID and then using
  the ID to interact with the element is really just taking the long way
  around.  Instead (unless it's not supported) use the thing you know to
  identify and interact with the element.

  On Dec 9, 11:02 am, Bhavesh bhavesh1_sha...@yahoo.com wrote:

   Ok,

   Here is the line that im matching from source from IE :

   DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td!
   sel href=javascript:; z.type=Lcfc/AIMG src=https://vm-
   bhaveshok2.kazeon.local/admin/images/
   green_dot.pngalign=absMiddleSPAN id=z_bp_vd
   title=bhavtestbhavtest/SPAN/DIV/TD

   My subroutine code is :

   def clickFSlink(fsname=)
         printClickInfo(clickfslink, fsname)
         $_ = $ie.html
         if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/
             printIDInfo(FS ID, $1)
             begin
               $ie.div(:id , $1).click
             rescue = e
               rescueHandle(e)
             end
             sleep($deepSleep)
         else
             puts FAILED! Could not find DatafsID
             return false
       end
   end

   My script is :

   require 'watir-webdriver'
   require 'Lib/KazeonCommon/BasicMethodLibrary'

   class test1 Test::Unit::TestCase

     def test_
         puts
   **

         printTestingReportHeader(I18N Regression Testing, WEB_ADMIN)
         puts
   **

     end

      def test_0001
       returnValue = true
           $ie.goto($adminLink)
           sleep(10)
           #skipSecurity(Continue to this website)
           kazeonLegalLogin(WEB_ADMIN, Local, admin, kazeon)
           sleep(5)
           

[wtr-general] Re: Webdriver : when i have to grab the id using pattern match it fails for firefox

2011-12-09 Thread Bhavesh
Hi,

Here is the source that get generated in IE:



TBODY
TR class=item  id=z_bp_td z.type=Lit z.disd=false
z.rid=z_bp_id z.inited=true
TD id=z_bp_ud z.type=Lic
DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td!
sel href=javascript:; z.type=Lcfc/AIMG src=https://vm-
bhaveshok2.kazeon.local/admin/images/green_dot.png
align=absMiddleSPAN id=z_bp_vd title=bhavtestbhavtest/SPAN/DIV/
TD
TD id=z_bp_0e align=left z.type=Lic
DIV class=cell-inner overflow-hidden id=z_bp_0e!cave /DIV/
TD
TD id=z_bp_1e style=WHITE-SPACE: nowrap z.type=Lic
DIV class=cell-inner overflow-hidden id=z_bp_1e!cave style=WHITE-
SPACE: nowrap
TABLE id=z_bp_2e style=BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-
LEFT: 0px; BORDER-BOTTOM: 0px cellSpacing=0 cellPadding=0
z.type=zul.box.Box
TBODY
TR id=z_bp_2e!cave vAlign=top
TD id=z_bp_3e!chdextr align=left z.coexist=true
TABLE id=z_bp_3e style=WIDTH: 25px cellSpacing=0 cellPadding=0
z.type=zul.box.Box
TBODY
TR id=z_bp_3e!cave vAlign=top
TD id=z_bp_4e!chdextr align=left z.coexist=trueIMG id=z_bp_4e
src=https://vm-bhaveshok2.kazeon.local/admin/images/datafs.png;
border=0 z.type=zul.widget.Img/TD/TR/TBODY/TABLE/TD
TD class=hbox-sp id=z_bp_3e!chdextr2IMG style=WIDTH: 0px; HEIGHT:
0px/TD
TD id=z_bp_5e!chdextr align=left z.coexist=trueSPAN
id=z_bp_5edatafs (nfs)/SPAN/TD/TR/TBODY/TABLE/DIV/TD
TD id=z_bp_6e z.type=Lic
DIV class=cell-inner overflow-hidden id=z_bp_6e!cavetestkaz/DIV/
TD
TD id=z_bp_7e title=ntap34 z.type=Lic
DIV class=cell-inner overflow-hidden id=z_bp_7e!caventap34/DIV/
TD
TD id=z_bp_8e title=/vol/data/bhavnfsdata2(tcp,rw) z.type=Lic
DIV class=cell-inner overflow-hidden id=z_bp_8e!cave/vol/data/
bhavnfsdata2(tcp,rw)/DIV/TD
TD id=z_bp_9e z.type=Lic
DIV class=cell-inner overflow-hidden id=z_bp_9e!cave0/DIV/TD
TD id=z_bp_ae z.type=Lic
DIV class=cell-inner overflow-hidden id=z_bp_ae!caveonline/DIV/
TD/TR
TR class=item odd id=z_bp_be z.type=Lit z.disd=false
z.rid=z_bp_id z.inited=true
TD id=z_bp_ce z.type=Lic

##


Here im matching bhavtest which is actually parameter #{fsname}.

By matching this line, im collecting id div z_bp_ud!cave

Then trying to click on that div in UI --

browser.div(:id , $1).click

Now this source is generated differentily in Firefox, so this pattern
match failed,  and im not able to use it.

Im using watir from last 2 years but always as a unit test framework.

I switched to Webdriver just now as a requirement and therefore i need
my previous code to be align to webdriver so that i can execute my
script on all browsers.

Can you help me out here?

Is there any way i can port all my scripts to webdriver?

Bhavesh


On Dec 9, 3:48 am, Željko Filipin zeljko.fili...@wa-research.ch
wrote:
 On Fri, Dec 9, 2011 at 12:56 AM, Bhavesh bhavesh1_sha...@yahoo.com wrote:
  so to collect the id's, i go to source of that page and grab the id
  like :
       $_ = $ie.html
       if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/
       printIDInfo(FS ID, $1)

 Why aren't you using watir api?

 Something like

 browser.divs(how, what).collect {|div| div.id}

 If you provide sample html, we could tell more.

 If it is for speed, there are a few html parsers for ruby:

 https://www.ruby-toolbox.com/categories/html_parsing

 Željko
 --
 watir.com/book - author

-- 
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


Re: [wtr-general] Re: Webdriver : when i have to grab the id using pattern match it fails for firefox

2011-12-09 Thread Željko Filipin
On Fri, Dec 9, 2011 at 7:06 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote:
 Here im matching bhavtest which is actually parameter #{fsname}.
 By matching this line, im collecting id div z_bp_ud!cave
 Then trying to click on that div in UI --
 browser.div(:id , $1).click

I am completely confused. Could you please send only the tag that interests
you and your watir code?

Željko

-- 
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: Webdriver : when i have to grab the id using pattern match it fails for firefox

2011-12-09 Thread Bhavesh
Ok,

Here is the line that im matching from source from IE :

DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td!
sel href=javascript:; z.type=Lcfc/AIMG src=https://vm-
bhaveshok2.kazeon.local/admin/images/
green_dot.pngalign=absMiddleSPAN id=z_bp_vd
title=bhavtestbhavtest/SPAN/DIV/TD


My subroutine code is :

def clickFSlink(fsname=)
  printClickInfo(clickfslink, fsname)
  $_ = $ie.html
  if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/
  printIDInfo(FS ID, $1)
  begin
$ie.div(:id , $1).click
  rescue = e
rescueHandle(e)
  end
  sleep($deepSleep)
  else
  puts FAILED! Could not find DatafsID
  return false
end
end


My script is :

require 'watir-webdriver'
require 'Lib/KazeonCommon/BasicMethodLibrary'



class test1 Test::Unit::TestCase


  def test_
  puts
**
  printTestingReportHeader(I18N Regression Testing, WEB_ADMIN)
  puts
**
  end

   def test_0001
returnValue = true
$ie.goto($adminLink)
sleep(10)
#skipSecurity(Continue to this website)
kazeonLegalLogin(WEB_ADMIN, Local, admin, kazeon)
sleep(5)
clickFSlink(bhavtest)   ## Here it fails for firefox.
   end

end


This works well in Ie, but when i use the same code by changing
browser to firefox, it fails.

Bhavesh

On Dec 9, 10:42 am, Željko Filipin zeljko.fili...@wa-research.ch
wrote:
 On Fri, Dec 9, 2011 at 7:06 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote:
  Here im matching bhavtest which is actually parameter #{fsname}.
  By matching this line, im collecting id div z_bp_ud!cave
  Then trying to click on that div in UI --
  browser.div(:id , $1).click

 I am completely confused. Could you please send only the tag that interests
 you and your watir code?

 Željko

-- 
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: Webdriver : when i have to grab the id using pattern match it fails for firefox

2011-12-09 Thread Chuck van der Linden
Lets backup a minute because I think you are going about this in a
very convoluted way based on something you figured out that works, but
may in fact be a bit of a kludge.

The div being clicked on contains a link, an image, and a span with
text.

First question, when interfacing with the site, how does a HUMAN know
what to click on?  Is it the image being displayed?  The text?  the
combination of the two?  or either?

If it's the text, then why not just select the div that way

  b.div(:text = 'bhavtest').click

 If it's the Image, then why not find that using a regex for the src
of the image, and then use .parent to locate the containing div and
click it?

   b.img(:src = /your_regex_here/).parent.click

if it needs to be a parameter then replace the constants above with a
variable, or a regex object created from a variable

If it's the combination of the two things (image and text) then you
might have to be a bit trickier but it should still be possible and a
bit more straightforward than what you were doing.



Using ID's to identify something is great where that is something you
can predict, but otherwise, if you are using some other means to find
the thing you want, doing that in order to get the ID and then using
the ID to interact with the element is really just taking the long way
around.  Instead (unless it's not supported) use the thing you know to
identify and interact with the element.

On Dec 9, 11:02 am, Bhavesh bhavesh1_sha...@yahoo.com wrote:
 Ok,

 Here is the line that im matching from source from IE :

 DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td!
 sel href=javascript:; z.type=Lcfc/AIMG src=https://vm-
 bhaveshok2.kazeon.local/admin/images/
 green_dot.pngalign=absMiddleSPAN id=z_bp_vd
 title=bhavtestbhavtest/SPAN/DIV/TD

 My subroutine code is :

 def clickFSlink(fsname=)
       printClickInfo(clickfslink, fsname)
       $_ = $ie.html
       if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/
           printIDInfo(FS ID, $1)
           begin
             $ie.div(:id , $1).click
           rescue = e
             rescueHandle(e)
           end
           sleep($deepSleep)
       else
           puts FAILED! Could not find DatafsID
           return false
     end
 end

 My script is :

 require 'watir-webdriver'
 require 'Lib/KazeonCommon/BasicMethodLibrary'

 class test1 Test::Unit::TestCase

   def test_
       puts
 **
       printTestingReportHeader(I18N Regression Testing, WEB_ADMIN)
       puts
 **
   end

    def test_0001
     returnValue = true
         $ie.goto($adminLink)
         sleep(10)
         #skipSecurity(Continue to this website)
         kazeonLegalLogin(WEB_ADMIN, Local, admin, kazeon)
         sleep(5)
         clickFSlink(bhavtest)   ## Here it fails for firefox.
    end

 end

 This works well in Ie, but when i use the same code by changing
 browser to firefox, it fails.

 Bhavesh

 On Dec 9, 10:42 am, Željko Filipin zeljko.fili...@wa-research.ch
 wrote:







  On Fri, Dec 9, 2011 at 7:06 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote:
   Here im matching bhavtest which is actually parameter #{fsname}.
   By matching this line, im collecting id div z_bp_ud!cave
   Then trying to click on that div in UI --
   browser.div(:id , $1).click

  I am completely confused. Could you please send only the tag that interests
  you and your watir code?

  Željko

-- 
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: Webdriver : when i have to grab the id using pattern match it fails for firefox

2011-12-09 Thread Bhavesh
Hi,

I got the solution,  i written code like this :

$ie.div(:class = cell-inner overflow-hidden, :text =
bhavtest).click

And it works.

But there are some cases where only thing we can get is id which is
dynamic like an text filed:

INPUT class=inputbg id=z_s8_td style=WIDTH: 150px; HEIGHT: 15px
z.type=zul.widget.Txbox.

Here it is only dynmaic id and not even any text.

I see two problems :

1. How can i enter text in this text field when i just have dynamic id
usng webdriver?

2. This particular html is present many times in a page,   so to get
the ID, which is dynamic, it is very difficult.  Here i cannot use
class as it is same in many text fields.  If i club index here then it
is alos risky as many text fileds gets added/removed as applicaiton
developed.

So is there any way i can identify this textbox?

Right now i pattern match it with few lines above this code, i mean
right now page is like

Name: Text field,
passwrod:Text filed

So i pattern  match with Name: then till this textfield. Grabs the
id and then enter text in it, like :

if /TD id=.*Name:.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*
\n.*\n.*\n.*\n.*\n.*\n.*INPUT class=inputbg id=(\S*) style=.*Txbox/

But in webdriver this pattern match is not usable, then i have a
problem, can you suggest any solution to this?

Bhavesh
On Dec 9, 2:21 pm, Chuck van der Linden sqa...@gmail.com wrote:
 Lets backup a minute because I think you are going about this in a
 very convoluted way based on something you figured out that works, but
 may in fact be a bit of a kludge.

 The div being clicked on contains a link, an image, and a span with
 text.

 First question, when interfacing with the site, how does a HUMAN know
 what to click on?  Is it the image being displayed?  The text?  the
 combination of the two?  or either?

 If it's the text, then why not just select the div that way

   b.div(:text = 'bhavtest').click

  If it's the Image, then why not find that using a regex for the src
 of the image, and then use .parent to locate the containing div and
 click it?

    b.img(:src = /your_regex_here/).parent.click

 if it needs to be a parameter then replace the constants above with a
 variable, or a regex object created from a variable

 If it's the combination of the two things (image and text) then you
 might have to be a bit trickier but it should still be possible and a
 bit more straightforward than what you were doing.

 Using ID's to identify something is great where that is something you
 can predict, but otherwise, if you are using some other means to find
 the thing you want, doing that in order to get the ID and then using
 the ID to interact with the element is really just taking the long way
 around.  Instead (unless it's not supported) use the thing you know to
 identify and interact with the element.

 On Dec 9, 11:02 am, Bhavesh bhavesh1_sha...@yahoo.com wrote:







  Ok,

  Here is the line that im matching from source from IE :

  DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td!
  sel href=javascript:; z.type=Lcfc/AIMG src=https://vm-
  bhaveshok2.kazeon.local/admin/images/
  green_dot.pngalign=absMiddleSPAN id=z_bp_vd
  title=bhavtestbhavtest/SPAN/DIV/TD

  My subroutine code is :

  def clickFSlink(fsname=)
        printClickInfo(clickfslink, fsname)
        $_ = $ie.html
        if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/
            printIDInfo(FS ID, $1)
            begin
              $ie.div(:id , $1).click
            rescue = e
              rescueHandle(e)
            end
            sleep($deepSleep)
        else
            puts FAILED! Could not find DatafsID
            return false
      end
  end

  My script is :

  require 'watir-webdriver'
  require 'Lib/KazeonCommon/BasicMethodLibrary'

  class test1 Test::Unit::TestCase

    def test_
        puts
  ** 
  
        printTestingReportHeader(I18N Regression Testing, WEB_ADMIN)
        puts
  ** 
  
    end

     def test_0001
      returnValue = true
          $ie.goto($adminLink)
          sleep(10)
          #skipSecurity(Continue to this website)
          kazeonLegalLogin(WEB_ADMIN, Local, admin, kazeon)
          sleep(5)
          clickFSlink(bhavtest)   ## Here it fails for firefox.
     end

  end

  This works well in Ie, but when i use the same code by changing
  browser to firefox, it fails.

  Bhavesh

  On Dec 9, 10:42 am, Željko Filipin zeljko.fili...@wa-research.ch
  wrote:

   On Fri, Dec 9, 2011 at 7:06 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote:
Here im matching bhavtest which is actually parameter #{fsname}.
By matching this line, im collecting id div z_bp_ud!cave
Then trying to click on that div in UI --
browser.div(:id , $1).click

   I am completely confused. Could you please send only the tag that 
   interests
   you and your watir code?

   

[wtr-general] Re: Webdriver : when i have to grab the id using pattern match it fails for firefox

2011-12-09 Thread Bhavesh
Well i got it working with index :

$ie.text_field(:class = inputbg, :index = 0).set bhavesh
sleep(5)

But still im finding ways.

Bhavesh

On Dec 9, 3:17 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote:
 Hi,

 I got the solution,  i written code like this :

 $ie.div(:class = cell-inner overflow-hidden, :text =
 bhavtest).click

 And it works.

 But there are some cases where only thing we can get is id which is
 dynamic like an text filed:

 INPUT class=inputbg id=z_s8_td style=WIDTH: 150px; HEIGHT: 15px
 z.type=zul.widget.Txbox.

 Here it is only dynmaic id and not even any text.

 I see two problems :

 1. How can i enter text in this text field when i just have dynamic id
 usng webdriver?

 2. This particular html is present many times in a page,   so to get
 the ID, which is dynamic, it is very difficult.  Here i cannot use
 class as it is same in many text fields.  If i club index here then it
 is alos risky as many text fileds gets added/removed as applicaiton
 developed.

 So is there any way i can identify this textbox?

 Right now i pattern match it with few lines above this code, i mean
 right now page is like

 Name: Text field,
 passwrod:Text filed

 So i pattern  match with Name: then till this textfield. Grabs the
 id and then enter text in it, like :

 if /TD id=.*Name:.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*
 \n.*\n.*\n.*\n.*\n.*\n.*INPUT class=inputbg id=(\S*) style=.*Txbox/

 But in webdriver this pattern match is not usable, then i have a
 problem, can you suggest any solution to this?

 Bhavesh
 On Dec 9, 2:21 pm, Chuck van der Linden sqa...@gmail.com wrote:







  Lets backup a minute because I think you are going about this in a
  very convoluted way based on something you figured out that works, but
  may in fact be a bit of a kludge.

  The div being clicked on contains a link, an image, and a span with
  text.

  First question, when interfacing with the site, how does a HUMAN know
  what to click on?  Is it the image being displayed?  The text?  the
  combination of the two?  or either?

  If it's the text, then why not just select the div that way

    b.div(:text = 'bhavtest').click

   If it's the Image, then why not find that using a regex for the src
  of the image, and then use .parent to locate the containing div and
  click it?

     b.img(:src = /your_regex_here/).parent.click

  if it needs to be a parameter then replace the constants above with a
  variable, or a regex object created from a variable

  If it's the combination of the two things (image and text) then you
  might have to be a bit trickier but it should still be possible and a
  bit more straightforward than what you were doing.

  Using ID's to identify something is great where that is something you
  can predict, but otherwise, if you are using some other means to find
  the thing you want, doing that in order to get the ID and then using
  the ID to interact with the element is really just taking the long way
  around.  Instead (unless it's not supported) use the thing you know to
  identify and interact with the element.

  On Dec 9, 11:02 am, Bhavesh bhavesh1_sha...@yahoo.com wrote:

   Ok,

   Here is the line that im matching from source from IE :

   DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td!
   sel href=javascript:; z.type=Lcfc/AIMG src=https://vm-
   bhaveshok2.kazeon.local/admin/images/
   green_dot.pngalign=absMiddleSPAN id=z_bp_vd
   title=bhavtestbhavtest/SPAN/DIV/TD

   My subroutine code is :

   def clickFSlink(fsname=)
         printClickInfo(clickfslink, fsname)
         $_ = $ie.html
         if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/
             printIDInfo(FS ID, $1)
             begin
               $ie.div(:id , $1).click
             rescue = e
               rescueHandle(e)
             end
             sleep($deepSleep)
         else
             puts FAILED! Could not find DatafsID
             return false
       end
   end

   My script is :

   require 'watir-webdriver'
   require 'Lib/KazeonCommon/BasicMethodLibrary'

   class test1 Test::Unit::TestCase

     def test_
         puts
   **

         printTestingReportHeader(I18N Regression Testing, WEB_ADMIN)
         puts
   **

     end

      def test_0001
       returnValue = true
           $ie.goto($adminLink)
           sleep(10)
           #skipSecurity(Continue to this website)
           kazeonLegalLogin(WEB_ADMIN, Local, admin, kazeon)
           sleep(5)
           clickFSlink(bhavtest)   ## Here it fails for firefox.
      end

   end

   This works well in Ie, but when i use the same code by changing
   browser to firefox, it fails.

   Bhavesh

   On Dec 9, 10:42 am, Željko Filipin zeljko.fili...@wa-research.ch
   wrote:

On Fri, Dec 9, 2011 at 7:06 PM, Bhavesh bhavesh1_sha...@yahoo.com 

[wtr-general] Re: webdriver - find a window

2011-12-08 Thread Chuck van der Linden


On Dec 7, 4:41 pm, weimar weimar1...@gmail.com wrote:
 Thanks
  browser.windows(:title = noop).should ==[] worked.

but with the title of your window I presume?  (yeah maybe silly to
ask, it's the tester in me.. never assume..)

-- 
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: webdriver - find a window

2011-12-07 Thread Chuck van der Linden
There's a call in watir-webdriver that returns a collection of windows
matching a given specification, if yours is not there, it should
return an empty array

Here's code from the specs for that method.  The very last of these
sounds like it would be exactly what you are looking for.

it only returns windows matching the given selector do
  browser.windows(:title = closeable window).size.should == 1
end

it raises ArgumentError if the selector is invalid do
  lambda { browser.windows(:name = foo) }.should
raise_error(ArgumentError)
end

it raises returns an empty array if no window matches the
selector do
  browser.windows(:title = noop).should == []
end



On Dec 7, 12:53 pm, hillary weimar1...@gmail.com wrote:
 Is there a webdriver equivalent to window.find in watir? I'm trying to
 assert that a window has been closed. So for my test, it passes if it can't
 find the window.

 In watir i used the following code:

         browser = Watir::Browser.attach(:url, /Account.aspx/)
         browser.image(:id, /tabAccounts/).click
         help = Watir::IE.find(:title, /User Guide/)
         help.should == nil

 My best guess for webdriver is:
         browser.window(:url, /Account.aspx/).use
         browser.image(:id, /tabAccounts/).click
           begin
                  browser.window(:title, /User Guide/).use
           rescue Watir::Exception::NoMatchingWindowFoundException
                  puts window not found
           end

 I'm using taza, so i'm not really sure that this code will produce a
 failure if the window is still active.

-- 
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


Re: [wtr-general] Re: webdriver - find a window

2011-12-07 Thread weimar
Thanks
 browser.windows(:title = noop).should ==[] worked.

On Wed, Dec 7, 2011 at 2:14 PM, Chuck van der Linden sqa...@gmail.comwrote:

 There's a call in watir-webdriver that returns a collection of windows
 matching a given specification, if yours is not there, it should
 return an empty array

 Here's code from the specs for that method.  The very last of these
 sounds like it would be exactly what you are looking for.

 it only returns windows matching the given selector do
  browser.windows(:title = closeable window).size.should == 1
end

it raises ArgumentError if the selector is invalid do
  lambda { browser.windows(:name = foo) }.should
 raise_error(ArgumentError)
end

it raises returns an empty array if no window matches the
 selector do
  browser.windows(:title = noop).should == []
end



 On Dec 7, 12:53 pm, hillary weimar1...@gmail.com wrote:
  Is there a webdriver equivalent to window.find in watir? I'm trying to
  assert that a window has been closed. So for my test, it passes if it
 can't
  find the window.
 
  In watir i used the following code:
 
  browser = Watir::Browser.attach(:url, /Account.aspx/)
  browser.image(:id, /tabAccounts/).click
  help = Watir::IE.find(:title, /User Guide/)
  help.should == nil
 
  My best guess for webdriver is:
  browser.window(:url, /Account.aspx/).use
  browser.image(:id, /tabAccounts/).click
begin
   browser.window(:title, /User Guide/).use
rescue Watir::Exception::NoMatchingWindowFoundException
   puts window not found
end
 
  I'm using taza, so i'm not really sure that this code will produce a
  failure if the window is still active.

 --
 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.comhttp://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com


-- 
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: Webdriver problems on Chrome

2011-02-16 Thread Tim Koopmans
Can you share the page being accessed or is it on an intranet site?

Regards,
Tim

On Feb 17, 5:41 am, xguarder shams...@gmail.com wrote:
 I just started using watir-webdriver, and was able to make it work
 well with Firefox. I am running into some problems on Chrome though
 (all on Mac OSX). Here is what I am observing.

 I type the following into irb, and all is good so far...

 irb(main):001:0 require 'rubygems'
 = true
 irb(main):002:0 require 'watir-webdriver'
 = true
 irb(main):003:0 $browser = Watir::Browser.new(:chrome)
 = #Watir::Browser:0x1016e7a88 url= title=

 After the 3rd step a Chrome session is launched, with a message
 stating ChromeDriver server started and connected. Please leave this
 tab open.

 Now, I go to my company's page...

 irb(main):004:0 $browser.goto(http://www.whatever.com;)
 = http://www.whatever.com/;

 A new tab is opened that has loaded the page. However, if I do a
 $browser.text, I am told
 Selenium::WebDriver::Error::NoSuchElementError: Was not on a page, so
 could not find elements .
 This does not happen on other sites like google or ebay. And I do not
 have this problem when using Firefox. Is there any known issues with
 Chrome being able to interact with certain types of pages?

 Thanks in advance!

-- 
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: WebDriver

2009-08-25 Thread Pallavi Sharma
Hi

Anyone here used WebDriver ever???

Please let me know.

On Thu, Aug 20, 2009 at 10:00 AM, Pallavi Sharma write2pall...@gmail.comwrote:

 Hi

 Has anyone used Webdriver[http://code.google.com/p/webdriver/] as a
 automation tool here??

 Is there any comparisions of the same available with watir?

 If used, can anyone share their experience with the tool?


 Thanks

 Pallavi.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---