परीक्षण में फन या वर्चुअल इंटेलिजेंस के लिए वीका के साथ वेब यूआई का परीक्षण

शुभ दोपहर, प्रिय हाबरा पाठकों। इस बार आईटी सेक्शन में, मैं आपके साथ भविष्य के बारे में कुछ सपना देखना चाहता था। उस युग के बारे में जब कृत्रिम बुद्धि एक आश्चर्य नहीं होगी, और रोबोट हमारे करीबी दोस्त बन जाएंगे ...



लेकिन सपना क्यों, मैंने सोचा। मैं आपको ऐसे ही एक प्राणी के बारे में बेहतर बताता हूं।



VIQA WTL - वर्चुअल इंटेलिजेंस क्वालिटी एश्योरेंस वेब टेस्टिंग टूल , या बस बाती से मिलें



वीका एक ऐसा उपकरण है जो वेब यूआई (साइटों, सरल शब्दों में) के परीक्षण के लिए वर्चुअल इंटेलिजेंस के साथ है जो उपयोगकर्ता के लिए समझ में आता है। टूल सेलेनियम के चारों ओर एक आवरण है और आपको बटन, टेक्स्ट फ़ील्ड, चेकलिस्ट और ड्रॉप-डाउन सूची, वेबसाइट, पेज और ब्लॉक जैसी अवधारणाओं का उपयोग करके परीक्षण परिदृश्यों का वर्णन करने की अनुमति देता है। यानी लोकप्रिय पेजऑब्जेक्ट पैटर्न का उपयोग करता है।



इस अवधारणा के कार्यान्वयन के अलावा, उपकरण में संबंधित क्षमताओं की एक विस्तृत श्रृंखला है और एक विशिष्ट वातावरण के लिए महान अनुकूलनशीलता है (जिस पर चर्चा नहीं की जाएगी)।



आई-फ्री में काम करने में जो उपकरण मैं उपयोग करता हूं, वह एसक्यूए डेज़ 15 कॉन्फ्रेंस में प्रस्तुत किया गया था (प्रस्तुति का वीडियो और वीडियो जल्द ही आयोजकों द्वारा पोस्ट किया जाएगा)। प्रस्तुति में, वीका ने इस क्षेत्र के सबसे लोकप्रिय उपकरण, यैंडेक्स क्यूए टूल के साथ तुलना प्रारूप का वर्णन किया। इस लेख में मैं अपनी ताकत और कमजोरियों को उजागर किए बिना टूल के बारे में और अधिक विस्तार से बताने की कोशिश करूंगा (जो लोग इसे समझना चाहते हैं उन्हें टिप्पणियों में अपने दम पर ऐसा करने के लिए आमंत्रित किया जाता है और / या सम्मेलन से वीडियो सुनें)।



आभासी बुद्धि



नाम से शुरू करता हूँ। मुझे लगता है कि आपको यह जानने में दिलचस्पी है कि वर्चुअल इंटेलिजेंस कहाँ से आता है, और मुझे इससे क्या मतलब है?

छवि



नाम बहुत लोकप्रिय कंप्यूटर गेम मास इफेक्ट से लिया गया है कहानी कुछ इस प्रकार है:

Kvarians की एक निश्चित गेलेक्टिक दौड़ ने आर्टिफिशियल इंटेलिजेंस बनाया, जो उन्होंने किया था, उसके खतरे को महसूस करते हुए, अपने प्राणियों के साथ लड़ाई में प्रवेश किया, इसे खो दिया और AI से संपन्न प्लेटफार्मों की एक दौड़ द्वारा अपने विश्व के सभी ग्रहों से निष्कासित कर दिया गया।

इन घटनाओं के बाद, एआई का विकास आकाशगंगा में निषिद्ध हो गया क्योंकि उनके नियंत्रण से बाहर होने का खतरा था। एआई के विपरीत, आकाशगंगा का व्यापक रूप से उपयोग किया जाता है VIवर्चुअल इंटेलीजेंस मानव-जैसे इंटरफेस का उपयोग करते हुए, लेकिन स्व-शिक्षा (और इसलिए उपयोग करने के लिए सुरक्षित नहीं है)।



तो, VI की मेरी समझ में:

  1. मानव भाषा। एक स्मार्ट प्रोग्राम जो किसी व्यक्ति के साथ उसकी भाषा में बातचीत करता है।
  2. उपयोग में आसानी। यह कार्यक्रम उपयोगकर्ताओं के विभिन्न स्तरों (कम प्रवेश सीमा, इसके सभी कार्यों के लिए कार्यान्वयन की उपस्थिति "डिफ़ॉल्ट रूप से समाधान के लिए पर्याप्त स्मार्ट है)
  3. Adjustability। एक प्रोग्राम जिसमें विशिष्ट वातावरण के लिए सीखने (अनुकूलित) करने की क्षमता होती है (एआई के विपरीत, प्रशिक्षण किसी व्यक्ति द्वारा किया जाता है, एआई सीखने के आंकड़ों द्वारा नहीं)




PageObjects



PageObjects की अवधारणा, सामान्य रूप से, यह सुझाव देती है कि जब वेब UI का परीक्षण किया जाता है, तो वेब पेज और तत्वों को उन पर वस्तुओं के रूप में देखना अच्छा होगा और तदनुसार, कोड में इसके लिए संस्थाएं हैं।



सीधे शब्दों में कहें, स्थानीय लोगों और चयनकर्ताओं द्वारा एक पृष्ठ पर टैग की तलाश करने के बजाय, आपको तार्किक कार्यक्षमता को एक वर्ग (उदाहरण के लिए, एक "बटन") और इस वर्ग के ऑब्जेक्ट के साथ काम करने की आवश्यकता है। टैग और लोकेटर के साथ नहीं।



इसके अलावा, उपरोक्त का मतलब है परीक्षण स्क्रिप्ट कोड और कोड को अलग करना जो आपकी साइट के पृष्ठों पर वस्तुओं का वर्णन करता है और उनके साथ काम करता है।



उसी समय, पेज ऑब्जेक्ट्स केवल एक अवधारणा है, और यह पेजफैक्ट्री को छोड़कर, दृष्टिकोण को लागू करने के लिए लगभग कोई उपकरण प्रदान नहीं करता है

PS आप यहां PageObjects के बारे में अधिक पढ़ सकते हैं। code.google.com/p/selenium/wiki/PageObjects या इंटरनेट पर जानकारी खोज सकते हैं।



PageObjects के अन्य कार्यान्वयन



SQA डेज़ 15 कॉन्फ्रेंस में बोलते हुए, मैंने एक अन्य टूल के बारे में बात करने की कोशिश की, जो पेजऑब्जेक्ट्स - एचटीएमएलइलिश टेम्प्लेट को लागू करता है, जो कि, मेरी राय में, इस क्षेत्र में एक नेता है। और मैंने विस्तार से वर्णन करने की कोशिश की कि मेरे पास क्या पर्याप्त नहीं था और मैंने एक समान कार्य के लिए अपना खुद का ढांचा बनाने का फैसला क्यों किया। इस लेख में मैं तुलना नहीं करूँगा, लेकिन बस इस बारे में बात करूंगा कि वीका क्या कर सकता है।



मूल अवधारणाएँ



विकी पर सभी तत्वों के दिल में Vielement है। वेबड्राइवर के सुपर वेबइलमेंट के विपरीत, जो सभी "तत्वों" का मिलन है और वह सब कुछ कर सकता है, यहां तक ​​कि वह भी नहीं जानता है (उदाहरण के लिए, एक बटन में sendKeys), VIElement सभी तत्वों का एक सामान्य हिस्सा है (चौराहा - सभी के सामान्य गुण तत्वों) और कर सकते हैं जो सभी तत्वों की विशेषता है। और यह नहीं पता है कि कुछ भी कैसे करना है जबर्दस्त (सभी VIElement तरीके हमेशा लागू होते हैं और एक परिणाम देंगे)।



जैसा कि मैंने कहा, वीका पेजऑब्जेक्ट पैटर्न को लागू करता है और यहां तक ​​कि इसे कुछ हद तक बढ़ाता है।



विकी के पास अवधारणाओं के लिए अलग-अलग कक्षाएं हैं जैसे: साइट (दृश्य), पृष्ठ (VIPage) और प्रत्येक तत्व के लिए एक बटन (बटन), चेकबॉक्स (चेकबॉक्स), पाठ क्षेत्र (टेक्स्टफिल्ड), आदि।



विकी में कोई भी तत्व या तो एक अलग तार्किक तत्व हो सकता है या तत्वों के किसी भी सेट का मिलन हो सकता है। उदाहरण के लिए, चेकबॉक्स में 3 तत्व होते हैं। VIPage में किसी भी संख्या में तत्व शामिल हो सकते हैं। इस दृष्टिकोण के संबंध में, विकी के पास ब्लॉक (जैसे यांडेक्स) नहीं हैं। तत्व ब्लॉक साधारण VI तत्व हैं जिनमें अन्य तत्व शामिल हैं ( उदाहरण 1 देखें)।



संरचना


PageObjects टेम्पलेट के अनुसार, आपकी साइट की संरचना का परीक्षण से अलग वर्णन किया गया है।



परीक्षण स्थल विवरण की संरचना इस प्रकार है:



विवरण के लिए, उदाहरण 2 देखें।



visite



मूल तत्व विजीट है। विज़िट में परीक्षण साइट के बारे में सभी सामान्य जानकारी शामिल हैं:

WebDriver सेटिंग्स, टाइमआउट और लॉगिंग सेटिंग्स, डोमेन यूआरएल पता, पेज सूची।

विज़िट की दो डिफ़ॉल्ट क्रियाएं हैं: मनमाना URL खोलने के लिए खोलें और डोमेन URL के लिए OpenHomePage।



VIPage



VIPage - परीक्षण किए गए पृष्ठ का वर्णन करता है। तत्वों और तत्वों के समूहों से मिलकर बनता है। हो सकता है अपेक्षित यूआरएल और शीर्षक। सेटिंग्स: अपेक्षित शीर्षक / url की जाँच करें या नहीं (डिफ़ॉल्ट रूप से, यदि Url निर्दिष्ट किया गया है, तो इसे चेक किया गया है, अन्यथा नहीं।)

तत्वों



सरल


ClickableElement, TextElement, ClickableText, Button, Checkbox, Link, TextArea, TextField
      
      







आइटम सूची


 CheckList, DropDown, RadioButtons
      
      







यौगिक तत्व


छवि आप अपनी पसंद के अनुसार आइटम समूह कर सकते हैं। उदाहरण के लिए, आप पृष्ठ के पाद लेख या शीर्ष लेख में शामिल तत्वों को समूहित कर सकते हैं। या लॉगिन फॉर्म में। उनका वर्णन करें और विभिन्न पृष्ठों पर उपयोग करें। सभी मिश्रित तत्वों का एक "संदर्भ" है - html तत्व का लोकेटर जिसमें वे स्थित हैं। एक समूह में तत्वों के लोकेटर "इस तत्व के अंदर" खोजे जाते हैं। उपयोग किया हुआ।



एक लाइन थोक भरना



परीक्षण साइटों पर, अक्सर ऐसे डेटासेट होते हैं जिन्हें कुछ समझ में आने वाली व्यावसायिक इकाई से भरना होता है। उदाहरण के लिए, यह पासपोर्ट डेटा, बैंक कार्ड या लेनदेन डेटा, उत्पादों का चयन करने के लिए फ़िल्टर या साइट पर कुछ कॉन्फ़िगर करने का एक पृष्ठ हो सकता है।



तार्किक ऐसे तत्वों को एक ब्लॉक में संयोजित करने की इच्छा है (उदाहरण के लिए, "पासपोर्ट डेटा"), और परीक्षण में कहते हैं "पासपोर्ट डेटा भरें"। यह देखते हुए कि इस तरह के डेटा आमतौर पर परीक्षण के इनपुट हैं और भविष्य में परिणामों को सत्यापित करने के लिए सबसे अधिक उपयोग किया जाएगा, उनके साथ काम करने के लिए एक निश्चित MyPassportData ऑब्जेक्ट का उपयोग करना तर्कसंगत है।



VIQA आपको एक पंक्ति में अतिरिक्त लागत के बिना इस ऑपरेशन को करने की अनुमति देता है।



पृष्ठ का वर्णन करते हुए, किसी भी स्थिति में, इन सभी क्षेत्रों का वर्णन करें, और PageObjects हमें संकेत देते हैं कि उन्हें एक ब्लॉक या पृष्ठ में संयोजित करें - VIQA (उदाहरण के लिए पासपोर्ट) के संदर्भ में। प्रत्येक VIElement, जैसा कि पहले उल्लेख किया गया है, इसमें उन तत्वों का एक संघ हो सकता है जिनमें यह शामिल है। इन सभी फ़ील्ड को भरने के लिए, आपको बस फ़ील्ड्स ( उदाहरण 3 देखें) को प्रशिक्षित करने की आवश्यकता है, पासपोर्ट के साथ FillFrom विधि को निष्पादित करें और इसे पैरामीटर के रूप में MyPassportData पास करें।



 PassportSection. FillFrom(MyPassportData);
      
      







इंटरफेस


विकी के सभी तत्वों को इंटरफेस के आधार पर बनाया गया है। यानी आप निश्चित रूप से, एक डिफ़ॉल्ट कार्यान्वयन है, लेकिन मुख्य बात यह है कि एक व्यक्ति एक वस्तु में क्या अर्थ रखता है। उदाहरण के लिए, जब हम एक बटन के बारे में बात करते हैं, तो हम इस बात से चिंतित नहीं होते हैं कि यह बटन कैसा दिखता है, और इससे भी अधिक इस बटन का HTML कोड और भी कम चिंतित है।



हम जानते हैं कि एक बटन एक ऐसी चीज़ है जिस पर आप क्लिक कर सकते हैं। खैर, कभी-कभी बटन के नाम होते हैं।



इस दृष्टिकोण के आधार पर, VIQA के किसी भी बटन में क्लिक एक्शन और एक लेबल विशेषता है। इन क्रियाओं का एक डिफ़ॉल्ट कार्यान्वयन है (बटन लोकेटर पर क्लिक किया जाता है, और लेबल इस लोकेटर पर मूल्य विशेषता का मूल्य है), लेकिन यदि आपका बटन बिल्कुल नहीं है , , :

Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .








, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)



, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .








, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();



.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .








, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();



. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .








, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .





, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()

Note:



MyButton.WaitTimeout(20).Click()





Note: .








, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .




 , ,  :  
      
      





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()

Note: .








, , :





Button, «» - .



C .



:

IButton, ICheckbox, ICheckList, IClickable, ILabeled, ILink, ISelector, ISetValue, ITextArea, IVIElement



VIAction

, VIAction.

, , :



:

( Click)

,

( GetLabel):

, ,

.

, , , - , Frame, , ( , ), . 4





, VIAction.

, Frame . 5





, , ( ) . 6 .



PageObjects, .

VISite.



var mySite = new VISite(“http://mysite.com”)







, , , .





, , , - . , , , .



VISite.Logger = new MyLogger();







.



VISite 3 :

WaitWebElementInSec – (5 ) WaitPageToLoadInSec – (20 ) RetryActionInMsec – ( ) (0,5 )



, . WaitPageToLoadInSec WaitWebElementInSec ( 7 ).



SmartSearch SmartClick

, Selenium . , , , ( , ). , .



, -, , , - .

VIQA «», , .



• Implicitly wait , ? .

• ? , (, Click ? )

- , , - . , , , , .

. — .





KillAllRunWebDrivers

WebDriver ( , ). . , , , .



(SetUpFixture) :



VISite.KillAllRunWebDrivers();







. .





WebDriver, beforesuit , WebDriver . - Open ( , BeforeTest: , .. DataSource -, ). , , , . 2-5 . - , , , , , VIQA .

VIQA ( ). Open, .. , . . .





. ( )



:

Java ( , HTML5) ( , Selenium JavaScript : , setAttribute ) , .



, , .

, , )

: vk.com/viqatools

email : viqablog@gmail.com



.



UPD: SQA Days 15 vimeo.com/95245507





:

1



public class Checkbox { public TextElement TextElement; public VIElement CheckSignElement; } public class LoginForm { public TextField LoginTxtField; public TextField PasswordTxtField; public Button LoginButton; }







2

[Site(Domain = "http://market.yandex.ru/")] public class MySite : VISite { [Page(Title = " ", Url = "http://mysite.ru/")] public HomePage HomePage; [Page(Title = " ", Url = "http://mysite.ru/somepage")] public SomePage SomePage; } [Page(Title = " ", Url = "http://mysite.ru/")] public class HomePage : VIPage { [Name(" ")] [Locate(ByClassName = "search")] public static SearchSection SearchSection; }





Note: Page .



public class SearchSection : VIElement { [Name(" ")] [Locate(ByXPath = "//*[@class='search_input'] public TextArea SearchTextField; [Name(" '")] [Locate(ByXPath = "//*[contains(text(),'')] [ClickReloadsPage] public Button SearchButton; public void SearchProduct(string productName) { SearchTextField.NewInput(productName); SearchButton.Click(); } }





Note: .



3

public class PassportData { public string Number; public string Series; public FullName FullName; } public class FullName { public string Name; public string SecondName; } [FillFromField("Number")] public TextField PassportNumberTxtField;





Note: Number -, .



[FillFromField("FullName.Name")] public TextField PassportNameTxtField;





Note: Name FullName



public ITextArea PassportSeriesTxtField = new TextField() { FillRule = ToFillRule<PassportData>(pd => (pd.Number != “”) ? pd.Series : “”)), }







Note: FillRule



4

(viElement, actionName, viAction) =>{ VISite.Logger.Event(viElement.DefaultLogMessage(text)); viAction.Invoke(); }







Note: VIAction

(actionName, viAction, logResult) =>{ VISite.Logger.Event(DefaultLogMessage(text)); var result = viAction.Invoke(); if (logResult != null) VISite.Logger.Event(logResult.Invoke(result)); return result; }





Note: VIAction

5

new RadioButtons(“ ”, “#sensorScreen”) { VIAction = (viElement, text, viAction) => { if (!FirstSensorRadioButton.IsDisplayed) SensorBlock.Click(); viAction.Invoke(); } };





Note: VIAction . .

6

[Name(Name = "Wi-fi"), Locate(ByXPath = "//*[@class='my-checkbox']")] public ICheckbox MyCheckbox1; [Name(Name = "Wi-fi"), Locate(ByClassName = “my-checkbox")] public Checkbox MyCheckbox2; public ICheckbox MyCheckbox3 = new Checkbox("Wi-fi", "#my-checkbox"); public Checkbox MyCheckbox4 = new Checkbox("Wi-fi", By.CssSelector("#my-checkbox"));





7

[Name(" ''")] [ClickReloadsPage] public IButton SearchButton;







Note: ClickReloadsPage



MyButton.WithPageLoadAction.Click()





Note:



MyButton.WaitTimeout(20).Click()





Note: .







All Articles