Tuesday 15 January 2013

How to click on a particular image within pop up window in watir-webdriver -


The first attempt is to use the water-webdriver to automate this as I go to the case of each exam , I learn new things and face new challenges. I am very grateful for all the questions and answers because this has helped me a lot.Thank you

I have a new challenge and it is with popup and I am not making it clear that lots of stack overflow How to solve it even after going through popup queries.

I have not written the water code yet ... just

I am trying to create a user profile - fill out the form with all relevant information and press the profile button . (It's all coded and works fine). When clicking on the Create Profile button a pop-up window is popped up with several images in it as a table and "Please click on the apple image" with text. The text is randomly generated - so instead of apple I can be asked to click on the plane. Then I have to click on that special image.

How can I do water-webdriver for me? Use the pop-up window to tell the water-webdriver, read the text at the top, match with the image and click on the image?

Thank you.


Here's the error I got. Also includes waiter code and HTML


Error:

  Logic error: invalid window selector: {: id = & gt ;, "Human Validation Context "} C: /Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.4/lib/watir-web driver / window.rb: 15: 'In Start' in: / Ruby 193 / Leib / Ruby / Gemstones / 1.9.1 / Gems / Water-WebDriver -0.6.4 / Leib / Water-WebDrive / Has_Windows RB: 35: `New 'in C: / RB19/3 / Lib / Ruby / Games / 1.9.1 / Games / Water-Videre -0.6.4 / BB / Water-WebDriver / H_WindoRB: 35:` In window '=============================================== ================================ $ B.window (: id = & gt; "humanware container"). $ B.link ("id => use" humanVerificationQ Uestion ". Click   
  

click on the image of an aircraft carrier gt; & lt; tbody & gt; & lt; Tr & gt; & lt; td & gt; & lt; div answer = "0" square = "human image" style = "float: left; background: url ('/ images / security_image_tile.png') No-repeat - 300px 0px; height: 100px; width: 100 Px "& gt; & amp; nbsp; & lt; / div & gt; & lt; / td> & lt; td & gt; & lt; div; answer =" 1 "class =" human image "style = "Float: left; background: url ('/ images / security_image_tile.png') No-repeat 0px -100px; height: 100px; width: 100px" & gt; & amp; nbsp; & lt; / div & gt; Lt; / td> & lt; td & gt; & lt; div = "2" square = "human image" style = "float: left; Background: url ('/ images / security_image_tile.png') No-repeat 0px -200px; Height: 100px; Width: 100px "& gt; & amp; nbsp; & lt; / div & gt; & lt; / td> & lt; td & gt; & lt; div =" 3 "class =" human image " Style = "float: left; Background: URL ('/ images / security_image_tile.png') No-repeat-200px-100px; Height: 100px; Width: 100px "& gt; & amp; nbsp; & lt; / div & gt; & lt; / td> & lt; / tr & gt; & lt; tr & gt; & lt; td & gt;
& lt; td & gt; & lt; div =" 5 "square =" human image " Style = "float: left; Background: url ('/ images / security_image_tile.png') No-repeat -600px-200px; Height: 100px; Width: 100px "& gt; & amp; nbsp; & lt; / div & gt; & lt; / td> & lt; td & gt;

When a new browser window is opened, you can use the Usage method.

  Browser. ((Title = & gt; "Distressed Popup"). Use browser.button (: id = & gt; "close"). Click End    

No comments:

Post a Comment