Skip to content

Commit

Permalink
[JS] Link element information code samples to github [deploy site]
Browse files Browse the repository at this point in the history
  • Loading branch information
harsha509 committed Oct 20, 2023
1 parent 1e52298 commit f3ab474
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html'
# Returns height, width, x and y coordinates referenced element
res = driver.find_element(name: "range_input").rect
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to url
await driver.get('https://www.selenium.dev/selenium/web/inputs.html');

// Returns height, width, x and y coordinates referenced element
let element = await driver.findElement(By.name("range_input")).getRect();
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L45">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to url
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
Expand Down Expand Up @@ -328,15 +324,9 @@ driver.get 'https://www.selenium.dev/selenium/web/colorPage.html'
cssValue = driver.find_element(:id, 'namedColor').css_value('background-color')

{{< /tab >}}
{{< tab header="JavaScript" >}}

// Navigate to Url
await driver.get('https://www.selenium.dev/selenium/web/colorPage.html');

// Retrieves the computed style property 'color' of linktext
let cssValue = await driver.findElement(By.id("namedColor")).getCssValue('background-color');

{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L76-L78">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}

// Navigate to Url
Expand Down Expand Up @@ -382,13 +372,9 @@ driver.get 'https://www.selenium.dev/selenium/web/linked_image.html'
# Retrieves the text of the element
text = driver.find_element(:id, 'justanotherlink').text
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to URL
await driver.get('https://www.selenium.dev/selenium/web/linked_image.html');

// retrieves the text of the element
let text = await driver.findElement(By.id('justanotherlink')).getText();
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L84-L86">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to URL
driver.get("https://www.selenium.dev/selenium/web/linked_image.html")
Expand Down Expand Up @@ -448,16 +434,9 @@ email_element=driver.find_element(name: 'email_input')
#fetch the value property associated with the textbox
emailVal = email_element.attribute("value");
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to the Url
await driver.get("https://www.selenium.dev/selenium/web/inputs.html");

// identify the email text box
const emailElement = await driver.findElements(By.xpath('//input[@name="email_input"]'));

//fetch the attribute "name" associated with the textbox
const nameAttribute = await emailElement.getAttribute("name");
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to URL
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html'
# Returns height, width, x and y coordinates referenced element
res = driver.find_element(name: "range_input").rect
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to url
await driver.get('https://www.selenium.dev/selenium/web/inputs.html');

// Returns height, width, x and y coordinates referenced element
let element = await driver.findElement(By.name("range_input")).getRect();
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L45">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to url
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
Expand Down Expand Up @@ -315,15 +311,9 @@ driver.get 'https://www.selenium.dev/selenium/web/colorPage.html'
cssValue = driver.find_element(:id, 'namedColor').css_value('background-color')

{{< /tab >}}
{{< tab header="JavaScript" >}}

// Navigate to Url
await driver.get('https://www.selenium.dev/selenium/web/colorPage.html');

// Retrieves the computed style property 'color' of linktext
let cssValue = await driver.findElement(By.id("namedColor")).getCssValue('background-color');

{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L76-L78">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}

// Navigate to Url
Expand Down Expand Up @@ -369,13 +359,9 @@ driver.get 'https://www.selenium.dev/selenium/web/linked_image.html'
# Retrieves the text of the element
text = driver.find_element(:id, 'justanotherlink').text
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to URL
await driver.get('https://www.selenium.dev/selenium/web/linked_image.html');

// retrieves the text of the element
let text = await driver.findElement(By.id('justanotherlink')).getText();
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L84-L86">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to URL
driver.get("https://www.selenium.dev/selenium/web/linked_image.html")
Expand Down Expand Up @@ -432,16 +418,9 @@ email_element=driver.find_element(name: 'email_input')
#fetch the value property associated with the textbox
emailVal = email_element.attribute("value");
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to the Url
await driver.get("https://www.selenium.dev/selenium/web/inputs.html");

// identify the email text box
const emailElement = await driver.findElements(By.xpath('//input[@name="email_input"]'));

//fetch the attribute "name" associated with the textbox
const nameAttribute = await emailElement.getAttribute("name");
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to URL
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html'
# Returns height, width, x and y coordinates referenced element
res = driver.find_element(name: "range_input").rect
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to url
await driver.get('https://www.selenium.dev/selenium/web/inputs.html');

// Returns height, width, x and y coordinates referenced element
let element = await driver.findElement(By.name("range_input")).getRect();
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L45">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to url
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
Expand Down Expand Up @@ -323,15 +319,9 @@ driver.get 'https://www.selenium.dev/selenium/web/colorPage.html'
cssValue = driver.find_element(:id, 'namedColor').css_value('background-color')

{{< /tab >}}
{{< tab header="JavaScript" >}}

// Navigate to Url
await driver.get('https://www.selenium.dev/selenium/web/colorPage.html');

// Retrieves the computed style property 'color' of linktext
let cssValue = await driver.findElement(By.id("namedColor")).getCssValue('background-color');

{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L76-L78">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}

// Navigate to Url
Expand Down Expand Up @@ -378,13 +368,9 @@ driver.get 'https://www.selenium.dev/selenium/web/linked_image.html'
# Retrieves the text of the element
text = driver.find_element(:id, 'justanotherlink').text
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to URL
await driver.get('https://www.selenium.dev/selenium/web/linked_image.html');

// retrieves the text of the element
let text = await driver.findElement(By.id('justanotherlink')).getText();
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L84-L86">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to URL
driver.get("https://www.selenium.dev/selenium/web/linked_image.html")
Expand Down Expand Up @@ -441,16 +427,9 @@ email_element=driver.find_element(name: 'email_input')
#fetch the value property associated with the textbox
emailVal = email_element.attribute("value");
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to the Url
await driver.get("https://www.selenium.dev/selenium/web/inputs.html");

// identify the email text box
const emailElement = await driver.findElements(By.xpath('//input[@name="email_input"]'));

//fetch the attribute "name" associated with the textbox
const nameAttribute = await emailElement.getAttribute("name");
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to URL
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html'
# Returns height, width, x and y coordinates referenced element
res = driver.find_element(name: "range_input").rect
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to url
await driver.get('https://www.selenium.dev/selenium/web/inputs.html');

// Returns height, width, x and y coordinates referenced element
let element = await driver.findElement(By.name("range_input")).getRect();
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L45">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to url
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
Expand Down Expand Up @@ -307,15 +303,9 @@ driver.get 'https://www.selenium.dev/selenium/web/colorPage.html'
cssValue = driver.find_element(:id, 'namedColor').css_value('background-color')

{{< /tab >}}
{{< tab header="JavaScript" >}}

// Navigate to Url
await driver.get('https://www.selenium.dev/selenium/web/colorPage.html');

// Retrieves the computed style property 'color' of linktext
let cssValue = await driver.findElement(By.id("namedColor")).getCssValue('background-color');

{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L76-L78">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}

// Navigate to Url
Expand Down Expand Up @@ -362,13 +352,9 @@ driver.get 'https://www.selenium.dev/selenium/web/linked_image.html'
# Retrieves the text of the element
text = driver.find_element(:id, 'justanotherlink').text
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to URL
await driver.get('https://www.selenium.dev/selenium/web/linked_image.html');

// retrieves the text of the element
let text = await driver.findElement(By.id('justanotherlink')).getText();
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L84-L86">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to URL
driver.get("https://www.selenium.dev/selenium/web/linked_image.html")
Expand Down Expand Up @@ -424,16 +410,9 @@ email_element=driver.find_element(name: 'email_input')
#fetch the value property associated with the textbox
emailVal = email_element.attribute("value");
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Navigate to the Url
await driver.get("https://www.selenium.dev/selenium/web/inputs.html");

// identify the email text box
const emailElement = await driver.findElements(By.xpath('//input[@name="email_input"]'));

//fetch the attribute "name" associated with the textbox
const nameAttribute = await emailElement.getAttribute("name");
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Navigate to URL
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
Expand Down

0 comments on commit f3ab474

Please sign in to comment.